Skip to content

Commit fda5b82

Browse files
committed
fix: lsp diagnostics user autocmd setup
1 parent 53856f5 commit fda5b82

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lua/nvim-tree.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,6 @@ local function setup_autocommands(opts)
383383
au User FugitiveChanged,NeogitStatusRefreshed lua require'nvim-tree'.refresh()
384384
]]
385385

386-
if opts.lsp_diagnostics then
387-
vim.cmd "au User LspDiagnosticsChanged lua require'nvim-tree.diagnostics'.update()"
388-
end
389386
if opts.auto_close then
390387
vim.cmd "au WinClosed * lua require'nvim-tree'.on_leave()"
391388
end

lua/nvim-tree/diagnostics.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ function M.setup(opts)
134134
for lhs, rhs in pairs(links) do
135135
vim.cmd("hi def link "..lhs.." "..rhs)
136136
end
137+
138+
if M.enable then
139+
if has_06 then
140+
vim.cmd "au User DiagnosticsChanged lua require'nvim-tree.diagnostics'.update()"
141+
else
142+
vim.cmd "au User LspDiagnosticsChanged lua require'nvim-tree.diagnostics'.update()"
143+
end
144+
end
137145
end
138146

139147
return M

0 commit comments

Comments
 (0)