refactor: use lua api for user commands and autocommands (#1206)

BREAKING: plugin now requires nvim-0.7
This commit is contained in:
Michael
2022-05-14 10:49:45 +03:00
committed by GitHub
parent 90d7b8edb1
commit 46014449b6
5 changed files with 81 additions and 44 deletions

View File

@@ -169,8 +169,13 @@ function M.setup(opts)
if M.enable then
log.line("diagnostics", "setup")
vim.cmd "au DiagnosticChanged * lua require'nvim-tree.diagnostics'.update()"
vim.cmd "au User CocDiagnosticChange lua require'nvim-tree.diagnostics'.update()"
a.nvim_create_autocmd("DiagnosticChanged", {
callback = M.update,
})
a.nvim_create_autocmd("User", {
pattern = "CocDiagnosticChange",
callback = M.update,
})
end
end