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

This commit is contained in:
Barrett Ruth 2026-03-13 21:25:48 -04:00 committed by GitHub
parent a1af48833b
commit eccb4785ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 53 additions and 41 deletions

View file

@ -636,11 +636,20 @@ function M.highlight_hunk(bufnr, ns, hunk, opts)
end
if opts.highlights.background and is_diff_line then
local bg_end_col = raw_len or (line_len + qw)
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, {
line_hl_group = line_hl,
number_hl_group = opts.highlights.gutter and number_hl or nil,
end_row = buf_line,
end_col = bg_end_col,
hl_group = line_hl,
hl_eol = true,
priority = p.line_bg,
})
if opts.highlights.gutter then
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, {
number_hl_group = number_hl,
priority = p.line_bg,
})
end
end
if is_marker and line_len > pw then