From 8386d23c817a3e3e4ee6302bd8e2902f7e297cf5 Mon Sep 17 00:00:00 2001 From: Tang-Tang Zhou Date: Thu, 7 Mar 2024 17:49:39 +0100 Subject: [PATCH] fix(util): clear buffer root cache when cwd change (#2502) --- lua/lazyvim/util/root.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 29581975..942cf413 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -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