Commit graph

3 commits

Author SHA1 Message Date
e40bc055b4 fix(merge): clear resolved state on buffer re-read
Problem: resolved_hunks and virtual text persisted when a diff buffer
was re-read, showing stale (resolved) markers for hunks that were no
longer resolved.

Solution: clear resolved_hunks[bufnr] and the merge namespace at the
top of setup_keymaps so each buffer init starts fresh.
2026-02-09 13:54:52 -05:00
910be50201 fix(merge): notify on navigation wrap-around
Problem: goto_next and goto_prev in the merge module wrapped silently
when reaching the last or first unresolved hunk.

Solution: add vim.notify before the wrap-around jump in both functions.
2026-02-09 13:54:03 -05:00
Barrett Ruth
a2053a132b
feat: unified diff conflict resolution for unmerged files (#99)
## Problem

Pressing `du` on a `UU` (unmerged) file in the fugitive status buffer
had no
effect. There was no way to see a proper ours-vs-theirs diff with syntax
highlighting and intra-line changes, or to resolve conflicts from within
a
unified diff view.

Additionally, pressing `du` on a section header containing only unmerged
files
showed "no changes in section" because `git diff` produces combined
(`diff --cc`)
output for unmerged files, which was stripped entirely.

## Solution

Fetch `:2:` (ours) and `:3:` (theirs) from the git index and generate a
standard
unified diff. The existing highlight pipeline (treesitter + intra-line)
applies
automatically. Resolution keymaps (`doo`/`dot`/`dob`/`don`) on hunks in
the diff
view write changes back to the working file's conflict markers.
Navigation
(`]x`/`[x`) jumps between unresolved conflict hunks.

For section diffs, combined diff entries are now replaced with generated
ours-vs-theirs unified diffs instead of being stripped.

Works for merge, cherry-pick, and rebase conflicts — git populates
`:2:`/`:3:`
the same way for all three.

Closes #61
2026-02-09 12:21:13 -05:00