Replies: 2 comments 3 replies
-
I was having a similar issue where when I deleted a file the tree would not update on other buffers. I solved it by adding the below to my init.lua.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
This sounds like a potential bug. Can you please raise a bug report ? The clean room replication will ensure that it's not a problem in your setup and allow us to reproduce. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using nvim-tree for several years now and recently had a bit of down time to tweak my setup.
I like to work with the tree open all the time and with the root set to my desired folder. This all works fine. The only problem I have is when I close a buffer. I noticed that in this case, the tree does not update to match the file displayed, which is a little irritating.
Initially, I tried using a function to call :Bdelete and then :NvimTreeRefresh but this does not work. The tree shown matches the deleted file and not the one subsequently displayed in the buffer. Manually entering NvimTreeRefresh, or toggling the display, both correct the problem.
Bdelete is from a plugin and so I tried with :bdelete, followed by closing and opening nvim-tree. This works as individual commands, but not as a function.
Also, chaining the commands as :bd | NvimTreeClose | NvimTreeOpen doesn't work. The tree is again stuck on the path of the deleted buffer. Issuing the commands one at a time results in the correct path being displayed.
As a temporary workaround, I have a function that calls :Bdelete and then :NvimTreeClose. If I then manually open nvim-tree, the tree is shown correctly. This is the least worst option compared to manually refreshing the tree after closing the buffer, which feels very inelegant.
Can anyone offer a better solution?
Beta Was this translation helpful? Give feedback.
All reactions