revert(#2781): "refactor: replace deprecated use of vim.diagnostic.is_disabled()" (#2784)

Revert "refactor: replace deprecated use of vim.diagnostic.is_disabled()  (#2781)"

This reverts commit 4215f33da5.
This commit is contained in:
Alexander Courtis 2024-05-26 11:34:03 +10:00 committed by GitHub
parent 4c8ddee453
commit 517e4fbb9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,14 +39,12 @@ end
local function from_nvim_lsp()
local buffer_severity = {}
local is_enabled
if vim.fn.has "nvim-0.10" == 1 then
is_enabled = vim.diagnostic.is_enabled()
else
is_enabled = not vim.diagnostic.is_disabled()
local is_disabled = false
if vim.fn.has "nvim-0.9" == 1 then
is_disabled = vim.diagnostic.is_disabled()
end
if is_enabled then
if not is_disabled then
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
local buf = diagnostic.bufnr
if vim.api.nvim_buf_is_valid(buf) then