mirror of
https://github.com/neovim/neovim.git
synced 2026-04-04 14:49:31 +00:00
fix(treesitter): do not modify highlight state for _on_spell_nav
Problem: Treesitter highlighter clears the already populated highlight
state when performing spell checking while drawing a
smoothscrolled topline.
Solution: Save and restore the highlight state in the highlighter's
_on_spell_nav callback.
This commit is contained in:
committed by
Lewis Russell
parent
be999e6a0e
commit
da4e8dc5b0
@@ -377,11 +377,15 @@ function TSHighlighter._on_spell_nav(_, _, buf, srow, _, erow, _)
|
||||
return
|
||||
end
|
||||
|
||||
-- Do not affect potentially populated highlight state. Here we just want a temporary
|
||||
-- empty state so the C code can detect whether the region should be spell checked.
|
||||
local highlight_states = self._highlight_states
|
||||
self:prepare_highlight_states(srow, erow)
|
||||
|
||||
for row = srow, erow do
|
||||
on_line_impl(self, buf, row, true)
|
||||
end
|
||||
self._highlight_states = highlight_states
|
||||
end
|
||||
|
||||
---@private
|
||||
|
||||
Reference in New Issue
Block a user