pub fn pair_split_view(hunk: &Hunk) -> Vec<SplitRow>Expand description
Pair context / removed / added lines for one hunk into left/right rows suitable for side-by-side rendering.
Algorithm (matches the brief):
- Walk the lines in source order.
- Context → duplicate text into BOTH left and right.
- Removed → push into
left, leaveright = None. - Added → push into
right, leaveleft = None. - Adjacent Removed-then-Added (and Added-then-Removed) pairs line up at the same row index so the visual gutter reads as a unified diff flipped sideways.
- Lone runs of one side collapse to per-row Nones so the renderer doesn’t waste vertical space on blank halves.