File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,15 @@ local luv = vim.loop
3
3
4
4
local utils = require " nvim-tree.utils"
5
5
local events = require " nvim-tree.events"
6
+ local view = require " nvim-tree.view"
6
7
7
8
local M = {}
8
9
9
10
local function close_windows (windows )
11
+ if view .View .float .enable and # a .nvim_list_wins () == 1 then
12
+ return
13
+ end
14
+
10
15
for _ , window in ipairs (windows ) do
11
16
if a .nvim_win_is_valid (window ) then
12
17
a .nvim_win_close (window , true )
@@ -18,11 +23,13 @@ local function clear_buffer(absolute_path)
18
23
local bufs = vim .fn .getbufinfo { bufloaded = 1 , buflisted = 1 }
19
24
for _ , buf in pairs (bufs ) do
20
25
if buf .name == absolute_path then
21
- if buf .hidden == 0 and # bufs > 1 then
26
+ if buf .hidden == 0 and ( # bufs > 1 or view . View . float . enable ) then
22
27
local winnr = a .nvim_get_current_win ()
23
28
a .nvim_set_current_win (buf .windows [1 ])
24
29
vim .cmd " :bn"
25
- a .nvim_set_current_win (winnr )
30
+ if not view .View .float .enable then
31
+ a .nvim_set_current_win (winnr )
32
+ end
26
33
end
27
34
a .nvim_buf_delete (buf .bufnr , { force = true })
28
35
if M .close_window then
You can’t perform that action at this time.
0 commit comments