fix(highlight): make intra-line bg visible under line backgrounds

Problem: `line_hl_group` bg unconditionally overrides `hl_group` bg
regardless of priority (neovim/neovim#31151). `DiffsAddText`/
`DiffsDeleteText` at p201 were invisible under `DiffsAdd`/`DiffsDelete`
`line_hl_group` at p200 because they operate on separate stacking layers.

Solution: replace `line_hl_group` with `hl_group` + `hl_eol` +
`end_col` for line backgrounds, putting them on the same layer as
intra-line highlights so priority governs stacking. Use single-row
extmarks (`end_row = buf_line`) to avoid the adjacent-hunk clearing
bug. Split `number_hl_group` into a separate extmark. Use raw
`DiffAdd.bg`/`DiffDelete.bg` for `DiffsAddText`/`DiffsDeleteText`
instead of alpha-blending toward Normal.bg, which produced
indistinguishable colors on dark themes.
This commit is contained in:
Barrett Ruth 2026-03-13 21:13:57 -04:00
parent a1af48833b
commit 8c41c7007c
5 changed files with 47 additions and 34 deletions

View file

@ -465,7 +465,7 @@ describe('email-quoted diffs', function()
local line_bg_count = 0
for _, mark in ipairs(extmarks) do
local d = mark[4]
if d and d.line_hl_group == 'DiffsAdd' then
if d and d.hl_group == 'DiffsAdd' then
line_bg_count = line_bg_count + 1
end
end