Skip to content

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

@barrettruth

Description

@barrettruth

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/merge tests continue to pass.

Verification

  • Add parser tests using single-rail display lines.
  • Add highlight tests for single-rail ranges and prefix concealment.
  • Add merge/conflict tests for single-rail generated merge diffs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions