• v0.2.1 cc5a368838

    fix(highlight): support combined diff format for unmerged files (#106)
    Some checks are pending
    luarocks / quality (push) Waiting to run
    luarocks / publish (push) Blocked by required conditions

    Ghost released this 2026-02-10 00:30:13 +00:00 | -7 commits to doc/merge-conflicts since this release

    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
    Downloads