fix(treesitter): use vim.highlight.priorities instead of hardcoded 100 (#24052)

Problem: Treesitter highlighting base priority cannot be customized.

Solution: Use `vim.highlight.priorities.treesitter` instead of hard-coded value.
This commit is contained in:
Santos Gallegos 2023-06-18 09:42:17 -05:00 committed by GitHub
parent 8a7e3353eb
commit 8c9dab3e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,12 +260,14 @@ local function on_line_impl(self, buf, line, is_spell_nav)
local spell_pri_offset = capture_name == 'nospell' and 1 or 0
if hl and end_row >= line and (not is_spell_nav or spell ~= nil) then
local priority = (tonumber(metadata.priority) or vim.highlight.priorities.treesitter)
+ spell_pri_offset
api.nvim_buf_set_extmark(buf, ns, start_row, start_col, {
end_line = end_row,
end_col = end_col,
hl_group = hl,
ephemeral = true,
priority = (tonumber(metadata.priority) or 100) + spell_pri_offset, -- Low but leaves room below
priority = priority,
conceal = metadata.conceal,
spell = spell,
})