File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ local M = {
9
9
}
10
10
11
11
local function close_windows (windows )
12
- if view .View .float .enable and # vim .api .nvim_list_wins () == 1 then
12
+ if view .View .float .enable and # vim .api .nvim_list_wins () < 3 then
13
13
return
14
14
end
15
15
@@ -24,15 +24,15 @@ local function clear_buffer(absolute_path)
24
24
local bufs = vim .fn .getbufinfo { bufloaded = 1 , buflisted = 1 }
25
25
for _ , buf in pairs (bufs ) do
26
26
if buf .name == absolute_path then
27
+ local tree_winnr = vim .api .nvim_get_current_win ()
27
28
if buf .hidden == 0 and (# bufs > 1 or view .View .float .enable ) then
28
- local winnr = vim .api .nvim_get_current_win ()
29
29
vim .api .nvim_set_current_win (buf .windows [1 ])
30
30
vim .cmd " :bn"
31
- if not view .View .float .enable then
32
- vim .api .nvim_set_current_win (winnr )
33
- end
34
31
end
35
32
vim .api .nvim_buf_delete (buf .bufnr , { force = true })
33
+ if not view .View .float .quit_on_focus_loss then
34
+ vim .api .nvim_set_current_win (tree_winnr )
35
+ end
36
36
if M .config .actions .remove_file .close_window then
37
37
close_windows (buf .windows )
38
38
end
You can’t perform that action at this time.
0 commit comments