fix(treesitter): use 0 as initial value for computing maximum (#27837)

Using -1 as the initial value can cause the pattern offset to become
negative, which in turn results in a negative subpriority, which fails
validation in nvim_buf_set_extmark.
This commit is contained in:
Gregory Anders 2024-03-12 16:13:40 -05:00 committed by GitHub
parent 119390e7ce
commit dc7ccd6bca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,7 +270,7 @@ local function on_line_impl(self, buf, line, is_spell_nav)
:iter_matches(root_node, self.bufnr, line, root_end_row + 1, { all = true })
end
local max_pattern_index = -1
local max_pattern_index = 0
while line >= state.next_row do
local pattern, match, metadata = state.iter()