Skip to content

Commit

Permalink
[Backport release-0.7] fix(treesitter): new iter if folded (#18990)
Browse files Browse the repository at this point in the history
fix(treesitter): new iter if folded

(cherry picked from commit 8780076)

Co-authored-by: kevinhwang91 <kevin.hwang@live.com>
  • Loading branch information
github-actions[bot] and kevinhwang91 committed Jun 16, 2022
1 parent 05ce04e commit ed9e6d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/lua/vim/treesitter/highlighter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ local function on_line_impl(self, buf, line)
-- Some injected languages may not have highlight queries.
if not highlighter_query:query() then return end

if state.iter == nil then
if state.iter == nil or state.next_row < line then
state.iter = highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1)
end

Expand Down

0 comments on commit ed9e6d1

Please sign in to comment.