fix: "Invalid buffer id" on closing nvim-tree window (#3129)
fix: invalid buffer issue Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
e4cd856ebf
commit
25d16aab7d
@ -242,6 +242,9 @@ local function setup_autocommands(opts)
|
|||||||
pattern = "*",
|
pattern = "*",
|
||||||
---@param ev vim.api.keyset.create_autocmd.callback_args
|
---@param ev vim.api.keyset.create_autocmd.callback_args
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
|
if not vim.api.nvim_buf_is_valid(ev.buf) then
|
||||||
|
return
|
||||||
|
end
|
||||||
if vim.api.nvim_get_option_value("filetype", { buf = ev.buf }) == "NvimTree" then
|
if vim.api.nvim_get_option_value("filetype", { buf = ev.buf }) == "NvimTree" then
|
||||||
require("nvim-tree.events")._dispatch_on_tree_close()
|
require("nvim-tree.events")._dispatch_on_tree_close()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user