diff options
author | Santos Gallegos <stsewd@proton.me> | 2023-06-18 09:42:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-18 16:42:17 +0200 |
commit | 8c9dab3e0d788d44c8a2fee83a6193f5955c814e (patch) | |
tree | b3107b6bacec9e07211958beb6f6f18fa5df83ca /runtime/lua/vim/treesitter/highlighter.lua | |
parent | 8a7e3353eb5bffb10015254917361266b4b20511 (diff) | |
download | rneovim-8c9dab3e0d788d44c8a2fee83a6193f5955c814e.tar.gz rneovim-8c9dab3e0d788d44c8a2fee83a6193f5955c814e.tar.bz2 rneovim-8c9dab3e0d788d44c8a2fee83a6193f5955c814e.zip |
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.
Diffstat (limited to 'runtime/lua/vim/treesitter/highlighter.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/highlighter.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua index 4bb764c5c6..d4db6bc404 100644 --- a/runtime/lua/vim/treesitter/highlighter.lua +++ b/runtime/lua/vim/treesitter/highlighter.lua @@ -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, }) |