[stacked] Make parser, highlighting, and merge handling rail-style aware #159

Closed
opened 2026-09-21 18:12:37 +00:00 by barrettruth · 0 comments
Owner

Original issue: barrettruth/diffs.nvim#365
Original author: barrettruth
Original date: 2026-05-28T02:57:41Z

Part of #358.

Goal

Make rail consumers style-aware so parsing, highlighting, and merge/conflict helpers work correctly with both dual and single rails.

Scope

  • Teach parser.parse_buffer() to read generated rail style and store it on parsed hunks where needed.
  • Update highlighting to use style-aware rail number range helpers.
  • Ensure hide_prefix overlays never cover single rail line numbers.
  • Ensure DiffsRail, DiffsRailNr, DiffsAddRailNr, and DiffsDeleteRailNr apply correctly in single rail buffers.
  • Ensure merge/conflict helpers strip single rails correctly before matching or resolving hunks.
  • Keep all raw hunk lines and intra-line diff logic rail-free.

Non-goals

  • Do not change hunk action semantics.
  • Do not change treesitter or intra-line diff algorithms except where column offsets must account for rail style.
  • Do not change native split endpoint windows.

Acceptance criteria

  • Parsed hunks from single-rail generated buffers match raw unified diff hunks.
  • Single rail highlighting is aligned and uses the expected highlight groups.
  • Merge/conflict parsing strips single rails and still resolves to working-file conflict regions.
  • Existing dual-rail parser, highlight, and merge behavior remains unchanged.
> Original issue: barrettruth/diffs.nvim#365 > Original author: `barrettruth` > Original date: 2026-05-28T02:57:41Z Part of #358. ## Goal Make rail consumers style-aware so parsing, highlighting, and merge/conflict helpers work correctly with both dual and single rails. ## Scope - Teach `parser.parse_buffer()` to read generated rail style and store it on parsed hunks where needed. - Update highlighting to use style-aware rail number range helpers. - Ensure `hide_prefix` overlays never cover single rail line numbers. - Ensure `DiffsRail`, `DiffsRailNr`, `DiffsAddRailNr`, and `DiffsDeleteRailNr` apply correctly in single rail buffers. - Ensure merge/conflict helpers strip single rails correctly before matching or resolving hunks. - Keep all raw hunk lines and intra-line diff logic rail-free. ## Non-goals - Do not change hunk action semantics. - Do not change treesitter or intra-line diff algorithms except where column offsets must account for rail style. - Do not change native split endpoint windows. ## Acceptance criteria - Parsed hunks from single-rail generated buffers match raw unified diff hunks. - Single rail highlighting is aligned and uses the expected highlight groups. - Merge/conflict parsing strips single rails and still resolves to working-file conflict regions. - Existing dual-rail parser, highlight, and merge behavior remains unchanged.
barrettruth 2026-09-21 18:12:37 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/diffs.nvim#159
No description provided.