Skip to content

Commit a55f11c

Browse files
authored
fix(fs_actions): check window valid on close buf (#658)
1 parent 39fd225 commit a55f11c

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
@@ -24,7 +24,7 @@ local function clear_buffer(path)
2424
local alt = vim.fn.bufnr("#")
2525
-- Check all windows to see if they are using the buffer
2626
for _, win in ipairs(vim.api.nvim_list_wins()) do
27-
if vim.api.nvim_win_get_buf(win) == buf then
27+
if vim.api.nvim_win_is_valid(win) and vim.api.nvim_win_get_buf(win) == buf then
2828
-- if there is no alternate buffer yet, create a blank one now
2929
if alt < 1 or alt == buf then
3030
alt = vim.api.nvim_create_buf(true, false)

0 commit comments

Comments
 (0)