We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae16aab commit 018a078Copy full SHA for 018a078
1 file changed
lua/nvim-tree/actions/fs/remove-file.lua
@@ -14,11 +14,18 @@ local M = {
14
15
---@param windows integer[]
16
local function close_windows(windows)
17
- -- Prevent from closing when the win count equals 1 or 2,
18
- -- where the win to remove could be the last opened.
19
- -- For details see #2503.
20
- if view.View.float.enable and #vim.api.nvim_list_wins() < 3 then
21
- return
+ -- When floating, prevent closing the last non-floating window.
+ -- For details see #2503, #3187.
+ if view.View.float.enable then
+ local non_float_count = 0
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
22
+ if vim.api.nvim_win_get_config(win).relative == "" then
23
+ non_float_count = non_float_count + 1
24
+ end
25
26
+ if non_float_count <= 1 then
27
+ return
28
29
end
30
31
for _, window in ipairs(windows) do
0 commit comments