feat: support vim.diagnostic.is_disabled() (#2232)
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -27,6 +27,12 @@ end
|
|||||||
local function from_nvim_lsp()
|
local function from_nvim_lsp()
|
||||||
local buffer_severity = {}
|
local buffer_severity = {}
|
||||||
|
|
||||||
|
local is_disabled = false
|
||||||
|
if vim.fn.has "nvim-0.9" == 1 then
|
||||||
|
is_disabled = vim.diagnostic.is_disabled()
|
||||||
|
end
|
||||||
|
|
||||||
|
if not is_disabled then
|
||||||
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
|
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
|
||||||
local buf = diagnostic.bufnr
|
local buf = diagnostic.bufnr
|
||||||
if vim.api.nvim_buf_is_valid(buf) then
|
if vim.api.nvim_buf_is_valid(buf) then
|
||||||
@@ -37,6 +43,7 @@ local function from_nvim_lsp()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return buffer_severity
|
return buffer_severity
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user