Skip to content

Commit d9edddb

Browse files
authored
fix(#1503): focus last win before close (#1509)
1 parent 09a5126 commit d9edddb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/nvim-tree/view.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ function M.close()
188188
local current_win = a.nvim_get_current_win()
189189
for _, win in pairs(a.nvim_list_wins()) do
190190
if tree_win ~= win and a.nvim_win_get_config(win).relative == "" then
191-
a.nvim_win_close(tree_win, true)
192191
local prev_win = vim.fn.winnr "#" -- this tab only
193192
if tree_win == current_win and prev_win > 0 then
194193
a.nvim_set_current_win(vim.fn.win_getid(prev_win))
195194
end
195+
a.nvim_win_close(tree_win, true)
196196
events._dispatch_on_tree_close()
197197
return
198198
end

0 commit comments

Comments
 (0)