Skip to content

Commit e3353c4

Browse files
authored
fix(#1529): ensure tree window exists before closing (#1537)
1 parent 2bb15fd commit e3353c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/nvim-tree/view.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ function M.close()
192192
if tree_win == current_win and prev_win > 0 then
193193
a.nvim_set_current_win(vim.fn.win_getid(prev_win))
194194
end
195-
a.nvim_win_close(tree_win, true)
195+
if a.nvim_win_is_valid(tree_win) then
196+
a.nvim_win_close(tree_win, true)
197+
end
196198
events._dispatch_on_tree_close()
197199
return
198200
end

0 commit comments

Comments
 (0)