fix(#2343): tree is now correctly abandoned upon an in-place open with eject=false (#2344)

This commit is contained in:
Danila Usachev 2023-08-01 03:53:58 +03:00 committed by GitHub
parent 4bd30f0137
commit 0a89dcb464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,8 +196,13 @@ local function setup_autocommands(opts)
create_nvim_tree_autocmd("BufWipeout", { create_nvim_tree_autocmd("BufWipeout", {
pattern = "NvimTree_*", pattern = "NvimTree_*",
callback = function() callback = function()
if utils.is_nvim_tree_buf(0) and opts.actions.open_file.eject then if not utils.is_nvim_tree_buf(0) then
return
end
if opts.actions.open_file.eject then
view._prevent_buffer_override() view._prevent_buffer_override()
else
view.abandon_current_window()
end end
end, end,
}) })