Skip to content

Commit 0a89dcb

Browse files
authored
fix(#2343): tree is now correctly abandoned upon an in-place open with eject=false (#2344)
1 parent 4bd30f0 commit 0a89dcb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/nvim-tree.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,13 @@ local function setup_autocommands(opts)
196196
create_nvim_tree_autocmd("BufWipeout", {
197197
pattern = "NvimTree_*",
198198
callback = function()
199-
if utils.is_nvim_tree_buf(0) and opts.actions.open_file.eject then
199+
if not utils.is_nvim_tree_buf(0) then
200+
return
201+
end
202+
if opts.actions.open_file.eject then
200203
view._prevent_buffer_override()
204+
else
205+
view.abandon_current_window()
201206
end
202207
end,
203208
})

0 commit comments

Comments
 (0)