mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-26 10:48:45 +02:00
fix(neo-tree): correctly set up cwd
(#3097)
* fix(neo-tree): correctly set up `cwd` * refactor: cleanup --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
f7450a5236
commit
30ce84f7a7
2 changed files with 21 additions and 7 deletions
|
@ -142,7 +142,10 @@ function M.setup()
|
|||
LazyVim.root.info()
|
||||
end, { desc = "LazyVim roots for the current buffer" })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, {
|
||||
-- FIX: doesn't properly clear cache in neo-tree `set_root` (which should happen presumably on `DirChanged`),
|
||||
-- probably because the event is triggered in the neo-tree buffer, therefore add `BufEnter`
|
||||
-- Maybe this is too frequent on `BufEnter` and something else should be done instead??
|
||||
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged", "BufEnter" }, {
|
||||
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
|
||||
callback = function(event)
|
||||
M.cache[event.buf] = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue