diff options
| author | pml68 <contact@pml68.dev> | 2025-01-07 01:26:51 +0100 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-01-07 01:26:51 +0100 |
| commit | 746708054055d0b85e782f1d7994fa49635a98bb (patch) | |
| tree | aea45f79f6941bcf41028aa0bb398af2268601f8 /lua | |
| parent | fix(docker): rust-analyzer wasn't in Neovim's RTP (diff) | |
| download | nvim-746708054055d0b85e782f1d7994fa49635a98bb.tar.gz | |
feat: add error and warning diagnostic counts to statusline
Diffstat (limited to '')
| -rw-r--r-- | lua/pml68/settings.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/pml68/settings.lua b/lua/pml68/settings.lua index 3361a7c..3484993 100644 --- a/lua/pml68/settings.lua +++ b/lua/pml68/settings.lua @@ -14,6 +14,11 @@ local function branch_name() end end +local function diagnostics() + local warns = vim.diagnostic.get(nil, { severity = vim.diagnostic.severity.WARN }) + local errors = vim.diagnostic.get(nil, { severity = vim.diagnostic.severity.ERROR }) + return string.format("[ %d| %d]", #warns, #errors) +end local function get_attached_clients() local buf_clients = vim.lsp.get_clients({ bufnr = 0 }) @@ -59,6 +64,8 @@ function Status_Line() .. vim.b.branch_name .. " %m" .. " %= " + .. diagnostics() + .. " " .. get_attached_clients() .. " [%{&filetype}]" .. " %l:%c " |
