From 5bd21aa75aa9e24c0680b23fc88380cd80a53641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Sat, 26 Oct 2024 19:02:55 -0700 Subject: [PATCH] fix: use vim.hl if available --- lua/treesitter-context/render.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/treesitter-context/render.lua b/lua/treesitter-context/render.lua index 2f2ceb77..25800946 100644 --- a/lua/treesitter-context/render.lua +++ b/lua/treesitter-context/render.lua @@ -148,7 +148,9 @@ local function highlight_contexts(bufnr, ctx_bufnr, contexts) else hl = buf_query.hl_cache[capture] end - local priority = tonumber(metadata.priority) or vim.highlight.priorities.treesitter + local priority = tonumber(metadata.priority) + or (vim.hl and vim.hl.priorities.treesitter) + or vim.highlight.priorities.treesitter add_extmark(ctx_bufnr, msrow, nscol, { end_row = merow, end_col = necol,