From 23391556fdf5678c1c655495f1ce424b5e6dfefa Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 8 Mar 2026 14:34:44 -0400 Subject: [PATCH] fix(highlight): apply gutter hl to prefix `+`/`-` for pw=1 diffs Problem: for regular unified diffs, the `+`/`-` prefix char at col 0 had no diffs.nvim extmark. Native TS `@diff.plus` colored it differently from `DiffsAddNr` in the gutter. Solution: add `DiffsAddNr`/`DiffsDeleteNr` at p199 on col 0..1 when `pw == 1` and `background` is enabled. Suppresses native TS at p100. --- lua/diffs/highlight.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/diffs/highlight.lua b/lua/diffs/highlight.lua index 493bcfc..434702d 100644 --- a/lua/diffs/highlight.lua +++ b/lua/diffs/highlight.lua @@ -612,6 +612,12 @@ function M.highlight_hunk(bufnr, ns, hunk, opts) }) end end + elseif opts.highlights.background and is_diff_line then + pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, { + end_col = 1, + hl_group = number_hl, + priority = p.syntax, + }) end if opts.highlights.background and is_diff_line then