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

Merged
barrettruth merged 3 commits from fix/intra-line-bg-visibility into main 2026-03-14 01:25:48 +00:00
barrettruth commented 2026-03-14 01:14:22 +00:00

tbh unsure how to test this well and not in the perfect mood for it... make an issue tracking the upstream one.

this should work for now

Closes #191 (thanks @phanen).

tbh unsure how to test this well and not in the perfect mood for it... make an issue tracking the upstream one. this should work for now Closes #191 (thanks @phanen).
phanen commented 2026-03-15 12:05:24 +00:00

it don't highlight the whole line for me:
image

Not sure what's end_col here, but this can make this work as expected for me:

diff --git a/lua/diffs/highlight.lua b/lua/diffs/highlight.lua
index 445354a..1045d81 100644
--- a/lua/diffs/highlight.lua
+++ b/lua/diffs/highlight.lua
@@ -636,10 +636,8 @@ 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, {
-          end_row = buf_line,
-          end_col = bg_end_col,
+          end_row = buf_line + 1,
           hl_group = line_hl,
           hl_eol = true,
           priority = p.line_bg,
image
it don't highlight the whole line for me: <img width="2024" height="501" alt="image" src="https://github.com/user-attachments/assets/5147ab1d-cb04-496a-86cf-4098858ed0ab" /> Not sure what's end_col here, but this can make this work as expected for me: ```diff diff --git a/lua/diffs/highlight.lua b/lua/diffs/highlight.lua index 445354a..1045d81 100644 --- a/lua/diffs/highlight.lua +++ b/lua/diffs/highlight.lua @@ -636,10 +636,8 @@ 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, { - end_row = buf_line, - end_col = bg_end_col, + end_row = buf_line + 1, hl_group = line_hl, hl_eol = true, priority = p.line_bg, ``` <img width="2020" height="547" alt="image" src="https://github.com/user-attachments/assets/d36e0f0d-616d-4668-9ce4-0f1f542e0c19" />
barrettruth commented 2026-03-15 14:06:18 +00:00

Damn. We're definitely looping on this. My bad...

Damn. We're definitely looping on this. My bad...
Sign in to join this conversation.
No description provided.