From 98b647f8fff0a31a5528684067840169c895c2cf Mon Sep 17 00:00:00 2001 From: ZacharyRizer Date: Thu, 23 May 2024 20:35:01 -0400 Subject: [PATCH 1/3] Deprecation fix --- lua/nvim-tree/diagnostics.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 6d0e1354149..5903e65b341 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -39,12 +39,15 @@ end local function from_nvim_lsp() local buffer_severity = {} - local is_disabled = false + local is_enabled = false if vim.fn.has "nvim-0.9" == 1 then - is_disabled = vim.diagnostic.is_disabled() + is_enabled = not vim.diagnostic.is_disabled() + end + if vim.fn.has "nvim-0.10" == 1 then + is_enabled = vim.diagnostic.is_enabled() 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 From 4b95d6e39fe5035f4fbef38a6a1fd49c9d91ecc5 Mon Sep 17 00:00:00 2001 From: ZacharyRizer Date: Thu, 23 May 2024 20:35:01 -0400 Subject: [PATCH 2/3] Deprecation fix --- 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 6d0e1354149..8a3500210be 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 = false + 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 From 15d282bdacd288a001c1b1de98dd5df24ee52727 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 25 May 2024 14:38:26 +1000 Subject: [PATCH 3/3] remove unnecessary assignment --- lua/nvim-tree/diagnostics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 8a3500210be..c11d37021fd 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -39,7 +39,7 @@ end local function from_nvim_lsp() local buffer_severity = {} - local is_enabled = false + local is_enabled if vim.fn.has "nvim-0.10" == 1 then is_enabled = vim.diagnostic.is_enabled() else