Skip to content

Commit

Permalink
fix: render stacked 'statuscolumn' highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvbaal committed Jan 23, 2025
1 parent bece284 commit 02ae16d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/treesitter-context/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ end

--- @class StatusLineHighlight
--- @field group string
--- @field groups? string[]
--- @field start integer

--- @param ctx_node_line_num integer
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 02ae16d

Please sign in to comment.