From 02ae16d32e818a473a9ac60424f90e40c175e792 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 23 Jan 2025 11:22:43 +0100 Subject: [PATCH] fix: render stacked 'statuscolumn' highlights --- lua/treesitter-context/render.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/treesitter-context/render.lua b/lua/treesitter-context/render.lua index f9a50e85..51056d6d 100644 --- a/lua/treesitter-context/render.lua +++ b/lua/treesitter-context/render.lua @@ -225,6 +225,7 @@ end --- @class StatusLineHighlight --- @field group string +--- @field groups? string[] --- @field start integer --- @param ctx_node_line_num integer @@ -291,9 +292,13 @@ local function highlight_lno_str(buf, text, highlights) local col = hl.start local endcol = hlidx < #linehl and linehl[hlidx + 1].start or #text[line] if col ~= endcol then + local hl_groups = hl.groups or { hl.group } + for i, shl in ipairs(hl_groups) do + hl_groups[i] = shl:find('LineNr') and 'TreesitterContextLineNumber' or shl + end add_extmark(buf, line - 1, col, { end_col = endcol, - hl_group = hl.group:find('LineNr') and 'TreesitterContextLineNumber' or hl.group, + hl_group = hl.groups and hl_groups or hl_groups[1] }) end end