Skip to content

Commit ab7d565

Browse files
committed
update coc autocommands
1 parent 1515ddf commit ab7d565

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/nvim-tree/diagnostics.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,13 @@ function M.setup(opts)
170170

171171
if M.enable then
172172
log.line("diagnostics", "setup")
173-
vim.cmd "au DiagnosticChanged * lua require'nvim-tree.diagnostics'.update()"
174-
vim.cmd "au User CocDiagnosticChange lua require'nvim-tree.diagnostics'.update()"
173+
a.nvim_create_autocmd("DiagnosticChanged", {
174+
callback = M.update,
175+
})
176+
a.nvim_create_autocmd("User", {
177+
pattern = "CocDiagnosticChanged",
178+
callback = M.update,
179+
})
175180
end
176181
end
177182

0 commit comments

Comments
 (0)