diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 5d0dee15..09e8ca09 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -370,7 +370,7 @@ local function setup_autocommands(opts) if not opts.actions.open_file.quit_on_open then create_nvim_tree_autocmd("BufWipeout", { pattern = "NvimTree_*", callback = view._prevent_buffer_override }) else - create_nvim_tree_autocmd("BufWipeout", { pattern = "NvimTree_*", callback = view.quit_on_open }) + create_nvim_tree_autocmd("BufWipeout", { pattern = "NvimTree_*", callback = view.abandon_current_window }) end if opts.hijack_directories.enable then diff --git a/lua/nvim-tree/view.lua b/lua/nvim-tree/view.lua index cb7a699d..c7fce70d 100644 --- a/lua/nvim-tree/view.lua +++ b/lua/nvim-tree/view.lua @@ -284,10 +284,6 @@ function M.abandon_current_window() M.View.tabpages[tab].winnr = nil end -function M.quit_on_open() - M.abandon_current_window() -end - function M.is_visible(opts) if opts and opts.any_tabpage then for _, v in pairs(M.View.tabpages) do