fix(treesitter): use capture metadata range if exists

use `treesitter.get_range` instead of inline expression
This commit is contained in:
danilax999 2023-04-04 14:26:21 +03:00 committed by GitHub
parent b83f949fd9
commit 469e6bfc56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,7 +236,8 @@ local function on_line_impl(self, buf, line, is_spell_nav)
break break
end end
local start_row, start_col, end_row, end_col = node:range() local range = vim.treesitter.get_range(node, buf, metadata[capture])
local start_row, start_col, _, end_row, end_col, _ = unpack(range)
local hl = highlighter_query.hl_cache[capture] local hl = highlighter_query.hl_cache[capture]
local capture_name = highlighter_query:query().captures[capture] local capture_name = highlighter_query:query().captures[capture]