mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(treesitter): check highlight queries exist
This commit is contained in:
@@ -208,6 +208,9 @@ local function on_line_impl(self, buf, line)
|
||||
local state = self:get_highlight_state(tstree)
|
||||
local highlighter_query = self:get_query(tree:lang())
|
||||
|
||||
-- Some injected languages may not have highlight queries.
|
||||
if not highlighter_query:query() then return end
|
||||
|
||||
if state.iter == nil then
|
||||
state.iter = highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user