File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -702,9 +702,13 @@ Window / buffer setup.
702
702
Configuration options for floating window
703
703
704
704
*nvim-tree.view.float.enable*
705
- Display nvim-tree window as float (enforces | nvim-tree.actions.open_file.quit_on_open | if set).
705
+ Display nvim-tree window as float (enforces if set).
706
706
Type: `boolean ` , Default: `false`
707
707
708
+ *nvim-tree.view.float.quit_on_focus_loss
709
+ When in floating mode, autoclose the popup when the popup loses the focus.
710
+ Type: `boolean ` , Default: `true`
711
+
708
712
*nvim-tree.view.float.open_win_config*
709
713
Floating window config. See | nvim_open_win | for more details.
710
714
Type: `table` or `function ` that returns a table, Default:
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ local function setup_autocommands(opts)
412
412
})
413
413
end
414
414
415
- if opts .view .float .enable then
415
+ if opts .view .float .enable and opts . view . float . quit_on_focus_loss then
416
416
create_nvim_tree_autocmd (" WinLeave" , { pattern = " NvimTree_*" , callback = view .close })
417
417
end
418
418
end
@@ -457,6 +457,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
457
457
},
458
458
float = {
459
459
enable = false ,
460
+ quit_on_focus_loss = true ,
460
461
open_win_config = {
461
462
relative = " editor" ,
462
463
border = " rounded" ,
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ function M.fn(mode, filename)
267
267
end
268
268
269
269
function M .setup (opts )
270
- M .quit_on_open = opts .actions .open_file .quit_on_open or opts . view . float . enable
270
+ M .quit_on_open = opts .actions .open_file .quit_on_open
271
271
M .resize_window = opts .actions .open_file .resize_window
272
272
if opts .actions .open_file .window_picker .chars then
273
273
opts .actions .open_file .window_picker .chars = tostring (opts .actions .open_file .window_picker .chars ):upper ()
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ local overlay_bufnr = nil
25
25
local overlay_winnr = nil
26
26
27
27
local function remove_overlay ()
28
- if view .View .float .enable then
28
+ if view .View .float .enable and view . View . float . quit_on_focus_loss then
29
29
-- return to normal nvim-tree float behaviour when filter window is closed
30
30
a .nvim_create_autocmd (" WinLeave" , {
31
31
pattern = " NvimTree_*" ,
You can’t perform that action at this time.
0 commit comments