feat: add actions.open_file.eject (#2341)

* feat: added prevent_buffer_override option to allow in-place opens by :e

* Moved option check inside the callback

* Renamed option to eject
This commit is contained in:
Danila Usachev
2023-07-29 10:45:03 +03:00
committed by GitHub
parent 75c05742bc
commit 4bd30f0137
2 changed files with 7 additions and 2 deletions

View File

@@ -196,7 +196,7 @@ local function setup_autocommands(opts)
create_nvim_tree_autocmd("BufWipeout", {
pattern = "NvimTree_*",
callback = function()
if utils.is_nvim_tree_buf(0) then
if utils.is_nvim_tree_buf(0) and opts.actions.open_file.eject then
view._prevent_buffer_override()
end
end,
@@ -545,6 +545,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
},
open_file = {
quit_on_open = false,
eject = true,
resize_window = true,
window_picker = {
enable = true,