src/side_diff.rs currently emits only <, > and blank gutters. Lines that exist in both files but differ are printed as a separate deletion and insertion instead of a single row with |.
The | is produced at print time, by pairing positionally inside a contiguous change hunk. For a run of N deletions and M insertions, the first min(N, M) are printed as pairs with |, and the leftovers keep < or >. The pairing is positional, so the two lines of a | row need nothing in common:
$ diff -y --width=40 L R # L: a,b1,b2,b3,c R: a,X,c
a a
b1 | X
b2 <
b3 <
c c
So the change is confined to the consumption of the current engine diff's. Buffer the run of Left/Right results, and on the next Both (or at EOF) flush it with the pairing above.
src/side_diff.rscurrently emits only<,>and blank gutters. Lines that exist in both files but differ are printed as a separate deletion and insertion instead of a single row with|.The
|is produced at print time, by pairing positionally inside a contiguous change hunk. For a run of N deletions and M insertions, the firstmin(N, M)are printed as pairs with|, and the leftovers keep<or>. The pairing is positional, so the two lines of a|row need nothing in common:So the change is confined to the consumption of the current engine diff's. Buffer the run of
Left/Rightresults, and on the nextBoth(or at EOF) flush it with the pairing above.