fix(view): prevent buffer override when actions.open_file.quit_on_open

* fix(view): prevent open buffer on NvimTree window when actions.open_file.quit_on_open is true

* fix(view): add view.quit_on_open function to prevent open on NvimTree window

Co-authored-by: btstream <btstream@gmail.com>
This commit is contained in:
btstream
2022-06-18 15:07:24 +08:00
committed by GitHub
parent b08003f546
commit e82a921baa
2 changed files with 6 additions and 1 deletions

View File

@@ -366,7 +366,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.abandon_current_window })
create_nvim_tree_autocmd("BufWipeout", { pattern = "NvimTree_*", callback = view.quit_on_open })
end
if opts.hijack_directories.enable then