new option: close windows displaying removed files (#1300)
This commit is contained in:
@@ -237,6 +237,7 @@ function M.setup(opts)
|
||||
require("nvim-tree.actions.trash").setup(opts.trash)
|
||||
require("nvim-tree.actions.open-file").setup(opts)
|
||||
require("nvim-tree.actions.change-dir").setup(opts)
|
||||
require("nvim-tree.actions.remove-file").setup(opts)
|
||||
require("nvim-tree.actions.copy-paste").setup(opts)
|
||||
require("nvim-tree.actions.create-file").setup(opts)
|
||||
require("nvim-tree.actions.expand-all").setup(opts)
|
||||
|
||||
@@ -25,7 +25,9 @@ local function clear_buffer(absolute_path)
|
||||
a.nvim_set_current_win(winnr)
|
||||
end
|
||||
a.nvim_buf_delete(buf.bufnr, { force = true })
|
||||
close_windows(buf.windows)
|
||||
if M.close_window then
|
||||
close_windows(buf.windows)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -88,4 +90,8 @@ function M.fn(node)
|
||||
end
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
M.close_window = opts.actions.remove_file.close_window
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user