nvim-tree.lua
nvim-tree.lua copied to clipboard
Reliably determine if nvim-tree is last window and exit gracefully
This is a PR aims to solve #1368 by parsing the window layout of the current window to reliably determine whether NvimTree if the last window and if so quits.
Also solving an apparent issue highlighted in snippet provided by readme this PR adds confirm quit
so that we can also get a graceful exit in the case of unsaved buffers in the background.
I was sorely missing this feature when it was deprecated so I am hoping that this is good enough for it to be added back in :)
To be honest, we removed this because there were too many people asking for different implementations of this feature. We spent a lot of time answering these issues. We don't want to maintain this, that's why we left it to the users. I believe a wiki page + a note in the readme would be good enough.
I totally understand, there were quite a few different ones flying around.
This solution should be quite a bit more robust in its approach compared to what was floating around, so at least the community can use it as they please
what i mean is that we won't merge that again, because even if it works better for some people, some other people will want different implementations. You can write a new wiki page once you are done with the implementation :)
No problem :)
Wiki / readme: yes
nvim-tree functionality: no
This is hugely problematic due to:
- unpredictable vim event ordering, especially factoring in nested autocommands
- vim plugins / automation modifying buffers and windows during
BufEnter