Skip to content

Commit 514bef7

Browse files
authored
fix(fs): check win valid before replace buf in window (#644)
fixes #632
1 parent 47b8d1b commit 514bef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/neo-tree/sources/filesystem/lib/fs_actions.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545
---@param new_buf number
4646
local function replace_buffer_in_windows(old_buf, new_buf)
4747
for _, win in ipairs(vim.api.nvim_list_wins()) do
48-
if vim.api.nvim_win_get_buf(win) == old_buf then
48+
if vim.api.nvim_win_is_valid(win) and vim.api.nvim_win_get_buf(win) == old_buf then
4949
vim.api.nvim_win_set_buf(win, new_buf)
5050
end
5151
end

0 commit comments

Comments
 (0)