fix(#3187): prevent closing the last non-floating window when deleting files#3282
fix(#3187): prevent closing the last non-floating window when deleting files#3282alex-courtis merged 1 commit intonvim-tree:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where nvim-tree would throw an E444: Cannot close last window error when deleting a file that's currently open, in configurations where multiple floating windows exist (such as from the Snacks plugin). The previous logic counted total windows, which failed when floating windows were present. The fix correctly counts only non-floating windows to determine when it's safe to close windows.
Changes:
- Updated window closing logic to count non-floating windows instead of total windows
- Prevents closing the last non-floating window when nvim-tree is in floating mode
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Ouch, sorry I did't realized I enabled AI reviews... Turing it off. |
alex-courtis
left a comment
There was a problem hiding this comment.
Many thanks for dealing with this one; that horrible < 3 has been hanging around for too long.
Code looks safe and clear.
Test ok:
- issue test case
- float enabled
- float disabled
- actions config commented
- default config
Fixes #3187