neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 3fd7449d5abe9a75fed8fb6b68c5958bd1a9ee12
parent 272ef271153b0f66410b0e59ce31e05d211b44fd
Author: Maria José Solano <majosolano99@gmail.com>
Date:   Tue, 17 Oct 2023 13:34:39 -0700

fix(treesitter): check that buf is loaded in autocommands (#25679)


Diffstat:
Mruntime/lua/vim/treesitter/dev.lua | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua @@ -366,6 +366,10 @@ function M.inspect_tree(opts) group = group, buffer = b, callback = function() + if not api.nvim_buf_is_loaded(buf) then + return true + end + api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1) local row = api.nvim_win_get_cursor(w)[1] local pos = pg:get(row) @@ -438,6 +442,9 @@ function M.inspect_tree(opts) group = group, buffer = b, callback = function() + if not api.nvim_buf_is_loaded(buf) then + return true + end api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1) end, }) @@ -449,7 +456,6 @@ function M.inspect_tree(opts) if not api.nvim_buf_is_loaded(b) then return true end - api.nvim_buf_clear_namespace(b, pg.ns, 0, -1) end, })