mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(treesitter): check that buf is loaded in autocommands (#25679)
This commit is contained in:

committed by
GitHub

parent
272ef27115
commit
3fd7449d5a
@@ -366,6 +366,10 @@ function M.inspect_tree(opts)
|
|||||||
group = group,
|
group = group,
|
||||||
buffer = b,
|
buffer = b,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
if not api.nvim_buf_is_loaded(buf) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1)
|
api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1)
|
||||||
local row = api.nvim_win_get_cursor(w)[1]
|
local row = api.nvim_win_get_cursor(w)[1]
|
||||||
local pos = pg:get(row)
|
local pos = pg:get(row)
|
||||||
@@ -438,6 +442,9 @@ function M.inspect_tree(opts)
|
|||||||
group = group,
|
group = group,
|
||||||
buffer = b,
|
buffer = b,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
if not api.nvim_buf_is_loaded(buf) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1)
|
api.nvim_buf_clear_namespace(buf, pg.ns, 0, -1)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@@ -449,7 +456,6 @@ function M.inspect_tree(opts)
|
|||||||
if not api.nvim_buf_is_loaded(b) then
|
if not api.nvim_buf_is_loaded(b) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
api.nvim_buf_clear_namespace(b, pg.ns, 0, -1)
|
api.nvim_buf_clear_namespace(b, pg.ns, 0, -1)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user