From 4215f33da55cf93163c5f429ec6f73af86be08c2 Mon Sep 17 00:00:00 2001 From: Zachary Rizer Date: Sat, 25 May 2024 00:42:34 -0400 Subject: [PATCH] refactor: replace deprecated use of vim.diagnostic.is_disabled() (#2781) * Deprecation fix * Deprecation fix * remove unnecessary assignment --------- Co-authored-by: Alexander Courtis --- lua/nvim-tree/diagnostics.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 6d0e1354..c11d3702 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -39,12 +39,14 @@ end local function from_nvim_lsp() local buffer_severity = {} - local is_disabled = false - if vim.fn.has "nvim-0.9" == 1 then - is_disabled = vim.diagnostic.is_disabled() + 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() end - if not is_disabled then + if is_enabled 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