Skip to content

Commit f4757a3

Browse files
committed
fix: fix quit_on_open == true behaviour on api.node.open.tab command
1 parent 0a2f219 commit f4757a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/nvim-tree/api.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,14 @@ Api.fs.copy.relative_path = wrap_node(wrap_explorer_member("clipboard", "copy_pa
233233
local function edit(mode, node, edit_opts)
234234
local file_link = node:as(FileLinkNode)
235235
local path = file_link and file_link.link_to or node.absolute_path
236+
local cur_tabpage = vim.api.nvim_get_current_tabpage()
237+
236238
actions.node.open_file.fn(mode, path)
237239

238240
edit_opts = edit_opts or {}
239241

240242
if edit_opts.quit_on_open then
241-
view.close()
243+
view.close(cur_tabpage)
242244
end
243245

244246
local focus = edit_opts.focus == nil or edit_opts.focus == true

0 commit comments

Comments
 (0)