nvim: add indicator for diagnostics to lualine
This commit is contained in:
parent
ff894c77a0
commit
14a0d8e7d2
1 changed files with 7 additions and 2 deletions
|
@ -8,13 +8,18 @@ return {
|
||||||
local window = require("fschauen.util.window")
|
local window = require("fschauen.util.window")
|
||||||
local orange = "#d65d0e"
|
local orange = "#d65d0e"
|
||||||
|
|
||||||
|
local is_diagnostics_enabled = function(bufnr)
|
||||||
|
return vim.diagnostic.is_enabled { bufnr = bufnr or 0 }
|
||||||
|
end
|
||||||
|
|
||||||
local autoformat = require("fschauen.util.autoformat").lualine()
|
local autoformat = require("fschauen.util.autoformat").lualine()
|
||||||
local branch = {
|
local branch = {
|
||||||
"branch",
|
"branch",
|
||||||
icon = require("fschauen.util.icons").git.Branch,
|
icon = require("fschauen.util.icons").git.Branch,
|
||||||
cond = window.is_medium,
|
cond = window.is_medium,
|
||||||
}
|
}
|
||||||
local diagnostics = dynamic_color("diagnostics")
|
local diagnostics = { dynamic_color("diagnostics"), cond = is_diagnostics_enabled }
|
||||||
|
local diag_status = { function() return "" end, cond = is_diagnostics_enabled }
|
||||||
local fileformat = { "fileformat", cond = window.is_medium }
|
local fileformat = { "fileformat", cond = window.is_medium }
|
||||||
local filename = "fschauen.filename"
|
local filename = "fschauen.filename"
|
||||||
local filetype = { dynamic_color("filetype"), cond = window.is_medium }
|
local filetype = { dynamic_color("filetype"), cond = window.is_medium }
|
||||||
|
@ -31,7 +36,7 @@ return {
|
||||||
lualine_b = { branch },
|
lualine_b = { branch },
|
||||||
lualine_c = { filename, status },
|
lualine_c = { filename, status },
|
||||||
lualine_x = { diagnostics, searchcount, whitespace, filetype },
|
lualine_x = { diagnostics, searchcount, whitespace, filetype },
|
||||||
lualine_y = { spell, wrap, autoformat, fileformat, "progress" },
|
lualine_y = { diag_status, spell, wrap, autoformat, fileformat, "progress" },
|
||||||
lualine_z = { "location" },
|
lualine_z = { "location" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue