changing directories from nvim-tree
not recognized - With Workaround
#178
Labels
bug
Something isn't working
nvim-tree
not recognized - With Workaround
#178
Describe the bug
If you have
nvim-tree
installed, you can change thepwd
, the buffers are not deleted. These buffers have a differentpwd
than the currentpwd
, which means that if you now open another file, you have to different buffers with differentpwd
's. This causes session corruptions when you try to restore the session, because it's trying to restore buffers from two different sessions.To Reproduce
Steps to reproduce the behavior:
nvim-tree
nvim
, open a file, and save the sessionnvim-tree
(with:NvimTreeOpen
), and change to the parent directory (u
). The buffer from the previous session is not deleted:SaveSession
again, and open a file in the parent directoryExpected behavior
I don't really think
autosession
is going to be able to solve this, other than by providing instructions on how to work withnvim-tree
, I just wanted to post my workaround for anyone else who is struggling.WORKAROUND
So, there are two main problems.
1.
nvim-tree
makes no attempt to be compatible with sessions.So, basically you have to close
nvim-tree
before you save the session, which you can do with hooks:2.
nvim-tree
useslcd
instead ofcd
, which doesn't trigger the hooksThis can be fixed in your
nvim-tree
config:That's all
There might be problems, as I just figured this out, but hopefully it will help someone else out there who's struggling with this.
The text was updated successfully, but these errors were encountered: