fix(util): clear buffer root cache when cwd change (#2502)

This commit is contained in:
Tang-Tang Zhou 2024-03-07 17:49:39 +01:00 committed by GitHub
parent e8e7d22f56
commit 8386d23c81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -144,7 +144,7 @@ function M.setup()
Util.root.info()
end, { desc = "LazyVim roots for the current buffer" })
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost" }, {
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, {
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
callback = function(event)
M.cache[event.buf] = nil