From 958bac90d28989e79c6c6f7a768fc1ac944ea79b Mon Sep 17 00:00:00 2001 From: kiyan Date: Wed, 20 Apr 2022 21:40:43 +0200 Subject: [PATCH] chore: drop 0.5 support in diagnostics --- lua/nvim-tree/diagnostics.lua | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 64f93516..68eca126 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -158,12 +158,11 @@ function M.update() log.profile_end(ps, "diagnostics update") end -local has_06 = vim.fn.has "nvim-0.6" == 1 local links = { - NvimTreeLspDiagnosticsError = has_06 and "DiagnosticError" or "LspDiagnosticsDefaultError", - NvimTreeLspDiagnosticsWarning = has_06 and "DiagnosticWarn" or "LspDiagnosticsDefaultWarning", - NvimTreeLspDiagnosticsInformation = has_06 and "DiagnosticInfo" or "LspDiagnosticsDefaultInformation", - NvimTreeLspDiagnosticsHint = has_06 and "DiagnosticHint" or "LspDiagnosticsDefaultHint", + NvimTreeLspDiagnosticsError = "DiagnosticError", + NvimTreeLspDiagnosticsWarning = "DiagnosticWarn", + NvimTreeLspDiagnosticsInformation = "DiagnosticInfo", + NvimTreeLspDiagnosticsHint = "DiagnosticHint", } function M.setup(opts) @@ -179,13 +178,8 @@ function M.setup(opts) end if M.enable then - if has_06 then - log.line("diagnostics", "setup has_06") - vim.cmd "au DiagnosticChanged * lua require'nvim-tree.diagnostics'.update()" - else - log.line("diagnostics", "setup not has_06") - vim.cmd "au User LspDiagnosticsChanged lua require'nvim-tree.diagnostics'.update()" - end + log.line("diagnostics", "setup") + vim.cmd "au DiagnosticChanged * lua require'nvim-tree.diagnostics'.update()" end end