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
33
44local utils = require " nvim-tree.utils"
55local events = require " nvim-tree.events"
6+ local view = require " nvim-tree.view"
67
78local M = {}
89
910local function close_windows (windows )
11+ if view .View .float .enable and # a .nvim_list_wins () == 1 then
12+ return
13+ end
14+
1015 for _ , window in ipairs (windows ) do
1116 if a .nvim_win_is_valid (window ) then
1217 a .nvim_win_close (window , true )
@@ -18,11 +23,13 @@ local function clear_buffer(absolute_path)
1823 local bufs = vim .fn .getbufinfo { bufloaded = 1 , buflisted = 1 }
1924 for _ , buf in pairs (bufs ) do
2025 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
2227 local winnr = a .nvim_get_current_win ()
2328 a .nvim_set_current_win (buf .windows [1 ])
2429 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
2633 end
2734 a .nvim_buf_delete (buf .bufnr , { force = true })
2835 if M .close_window then
You can’t perform that action at this time.
0 commit comments