chore: drop 0.5 support in diagnostics

This commit is contained in:
kiyan
2022-04-20 21:40:43 +02:00
parent 0f0f858348
commit 958bac90d2

View File

@@ -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")
log.line("diagnostics", "setup")
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
end
end