Skip to content

Commit 505167e

Browse files
committed
fix: fix focus == false behaviour on api.node.open.tab command
1 parent 980a5c1 commit 505167e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/nvim-tree/api.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ local function edit(mode, node, edit_opts)
243243

244244
local focus = edit_opts.focus == nil or edit_opts.focus == true
245245
if not focus then
246+
-- if mode == "tabnew" a new tab will be opened and we need to focus back to the previous tab
247+
if mode == "tabnew" then
248+
vim.cmd(":tabprev")
249+
end
246250
view.focus()
247251
end
248252
end

0 commit comments

Comments
 (0)