Skip to content

Commit 99d8c11

Browse files
committed
fix: ensure focus always focuses if window open
1 parent fb014ac commit 99d8c11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/neo-tree/command/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ do_show_or_focus = function(args, state, force_navigate)
157157
end)
158158
elseif args.action == "focus" then
159159
-- "focus" mean open and jump to the window if closed, and just focus it if already opened
160-
if window_exists and not force_navigate then
160+
if window_exists then
161161
vim.api.nvim_set_current_win(state.winid)
162-
else
162+
end
163+
if force_navigate or not window_exists then
163164
close_other_sources()
164165
manager.navigate(state, state.path, args.reveal_file)
165166
end

0 commit comments

Comments
 (0)