refactor: split predicates and directives

This commit is contained in:
vanaigr
2024-12-18 01:06:41 -06:00
parent 8d2ee542a8
commit dd234135ad
4 changed files with 107 additions and 72 deletions

View File

@@ -299,6 +299,8 @@ local function on_line_impl(self, buf, line, is_spell_nav)
state.highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1)
end
local captures = state.highlighter_query:query().captures
while line >= state.next_row do
local capture, node, metadata, match = state.iter(line)
@@ -311,7 +313,7 @@ local function on_line_impl(self, buf, line, is_spell_nav)
if capture then
local hl = state.highlighter_query:get_hl_from_capture(capture)
local capture_name = state.highlighter_query:query().captures[capture]
local capture_name = captures[capture]
local spell, spell_pri_offset = get_spell(capture_name)