Skip to content

Commit d87dc22

Browse files
committed
fix: invalid buffer issue
1 parent e7d1b7d commit d87dc22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/nvim-tree.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ local function setup_autocommands(opts)
242242
pattern = "*",
243243
---@param ev vim.api.keyset.create_autocmd.callback_args
244244
callback = function(ev)
245+
if not vim.api.nvim_buf_is_valid(ev.buf) then
246+
return
247+
end
245248
if vim.api.nvim_get_option_value("filetype", { buf = ev.buf }) == "NvimTree" then
246249
require("nvim-tree.events")._dispatch_on_tree_close()
247250
end

0 commit comments

Comments
 (0)