[nvim] fix: statusline diagnostics

diagnostics are buffer-specific
This commit is contained in:
David JULIEN 2022-05-02 23:32:25 +02:00
parent 0cb56c9a46
commit 407d9983a8

View File

@ -99,7 +99,7 @@ local function get_mode_color(m)
end
-- from https://github.com/nvim-lua/lsp-status.nvim/blob/master/lua/lsp-status/diagnostics.lua
local function get_lsp_diagnostics(bufnr)
local function get_lsp_diagnostics()
local result = {}
local levels = {
errors = "Error",
@ -110,7 +110,7 @@ local function get_lsp_diagnostics(bufnr)
for k, level in pairs(levels) do
local count = 0
local diags = vim.diagnostic.get(bufnr, { severity = level })
local diags = vim.diagnostic.get(0, { severity = level })
for _, _ in pairs(diags) do
count = count + 1
end