aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/highlighter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/treesitter/highlighter.lua')
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index 84b6a5f135..e003cf577a 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -22,8 +22,6 @@ local _link_default_highlight_once = function(from, to)
return from
end
--- These are conventions defined by nvim-treesitter, though it
--- needs to be user extensible also.
TSHighlighter.hl_map = {
["error"] = "Error",
@@ -116,7 +114,7 @@ function TSHighlighterQuery:_get_hl_from_capture(capture)
-- From "Normal.left" only keep "Normal"
return vim.split(name, '.', true)[1], true
else
- return TSHighlighter.hl_map[name] or name, false
+ return TSHighlighter.hl_map[name] or 0, false
end
end
@@ -248,7 +246,7 @@ local function on_line_impl(self, buf, line)
end
while line >= state.next_row do
- local capture, node = state.iter()
+ local capture, node, metadata = state.iter()
if capture == nil then break end
@@ -260,7 +258,7 @@ local function on_line_impl(self, buf, line)
{ end_line = end_row, end_col = end_col,
hl_group = hl,
ephemeral = true,
- priority = 100 -- Low but leaves room below
+ priority = tonumber(metadata.priority) or 100 -- Low but leaves room below
})
end
if start_row > line then