fix(treesitter): not refreshing virtualtext contents #33361

Problem: In some cases, when treesitter is enabled, deleting a
line below virtualtext will not refresh all updated lines.
https://github.com/neovim/neovim/issues/33358

Solution: Revert a part of https://github.com/neovim/neovim/pull/31324
to ensure that the full range (with virtual lines) is refreshed.

(cherry picked from commit cf59631f65)
This commit is contained in:
Dmitry Zolotukhin
2025-04-07 12:56:40 +02:00
committed by github-actions[bot]
parent c158d41cec
commit 4c1121bd33

View File

@@ -237,7 +237,7 @@ end
---@param changes Range6[]
function TSHighlighter:on_changedtree(changes)
for _, ch in ipairs(changes) do
api.nvim__redraw({ buf = self.bufnr, range = { ch[1], ch[4] }, flush = false })
api.nvim__redraw({ buf = self.bufnr, range = { ch[1], ch[4] + 1 }, flush = false })
-- Only invalidate the _conceal_checked range if _conceal_line is set and
-- ch[4] is not UINT32_MAX (empty range on first changedtree).
if ch[4] == 2 ^ 32 - 1 then