mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
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:
@@ -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 })
|
:iter_matches(root_node, self.bufnr, line, root_end_row + 1, { all = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
local max_pattern_index = -1
|
local max_pattern_index = 0
|
||||||
while line >= state.next_row do
|
while line >= state.next_row do
|
||||||
local pattern, match, metadata = state.iter()
|
local pattern, match, metadata = state.iter()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user