Skip to content

Commit 4215f33

Browse files
refactor: replace deprecated use of vim.diagnostic.is_disabled() (#2781)
* Deprecation fix * Deprecation fix * remove unnecessary assignment --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
1 parent 2bc725a commit 4215f33

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lua/nvim-tree/diagnostics.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ end
3939
local function from_nvim_lsp()
4040
local buffer_severity = {}
4141

42-
local is_disabled = false
43-
if vim.fn.has "nvim-0.9" == 1 then
44-
is_disabled = vim.diagnostic.is_disabled()
42+
local is_enabled
43+
if vim.fn.has "nvim-0.10" == 1 then
44+
is_enabled = vim.diagnostic.is_enabled()
45+
else
46+
is_enabled = not vim.diagnostic.is_disabled()
4547
end
4648

47-
if not is_disabled then
49+
if is_enabled then
4850
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
4951
local buf = diagnostic.bufnr
5052
if vim.api.nvim_buf_is_valid(buf) then

0 commit comments

Comments
 (0)