diffs.nvim/spec
Barrett Ruth cc5a368838
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
fix(highlight): support combined diff format for unmerged files (#106)
## Problem

Fugitive shows combined diffs (`@@@` headers, 2-character prefixes like
`++`, ` +`, `+ `) for unmerged (`UU`) files. The parser and highlight
pipeline assumed unified diff format (`@@`, 1-char prefix), causing:

- Prefix concealment only hiding 1 of 2 prefix chars
- Missing background colors on ` +` and `+ ` lines (first char is space
→ misclassified as context)
- No treesitter highlights (extra prefix char poisoned code arrays)
- `U` file header not recognized by parser (missing from filename
pattern)

## Solution

Detect prefix width from leading `@` count in hunk headers (`@@` → 1,
`@@@` → 2). Propagate `prefix_width` through the pipeline:

- **Parser**: new `prefix_width` field on `diffs.Hunk`, `U` added to
filename pattern, combined diff range extraction
- **Highlight**: prefix stripping, `col_offset`, concealment width, and
line classification all use `prefix_width`
- **Intra-line**: skipped for combined diffs (`prefix_width > 1`) since
2-char prefix semantics don't produce meaningful change groups
2026-02-09 19:30:13 -05:00
..
commands_spec.lua feat: unified diff conflict resolution for unmerged files (#99) 2026-02-09 12:21:13 -05:00
conflict_spec.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
diff_spec.lua feat(config): replace algorithm 'auto'/'native' with 'default'/'vscode' 2026-02-06 21:23:40 -05:00
fugitive_spec.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
git_spec.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
helpers.lua fix(highlight): include treesitter injections 2026-02-07 14:26:11 -05:00
highlight_spec.lua fix(highlight): support combined diff format for unmerged files (#106) 2026-02-09 19:30:13 -05:00
init_spec.lua feat(config): use vim.g over .setup() 2026-02-03 16:18:55 -05:00
merge_spec.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
minimal_init.lua feat(test): testing infrastructure 2026-02-01 23:09:05 -05:00
parser_spec.lua fix(highlight): support combined diff format for unmerged files (#106) 2026-02-09 19:30:13 -05:00
read_buffer_spec.lua fix(commands): handle :e on diffs:// buffers via BufReadCmd 2026-02-06 22:21:33 -05:00
ux_spec.lua fix(commands): add diff buffer UX improvements 2026-02-07 16:48:31 -05:00