src/side_diff.rs pads the left half up to a fixed column and writes the right half after it, instead of padding from the column where the text ended. Three rows come out different from GNU diff:
- The right half of an unchanged row starts at
half_width + 3 instead of column two. The two are the same at the default --width=130, so it only shows at other widths and with --expand-tabs.
- A blank line common to both files is padded up to column two instead of left empty.
- A tab that reaches the end of the half is dropped, and the text after it is still printed. GNU diff cuts the row at that tab.
Tabs are shown as ^I and line ends as $:
$ diff -y --width=40 L R | cat -A # L: a,(blank),b,c R: a,(blank),c
a^I^I a$
^I^I $
b^I^I <$
c^I^I c$
$ diff -y --width=10 L R | cat -A # L: a<TAB>b,c R: c
ab <$
c c$
GNU diff 3.10 prints:
a^I^I^Ia$
$
b^I^I <$
c^I^I^Ic$
a <$
c^Ic$
So the change is confined to process_half_line and push_output. Print only the text of each half, keep the column where the output stopped, and pad from that column to the marker and to column two.
src/side_diff.rspads the left half up to a fixed column and writes the right half after it, instead of padding from the column where the text ended. Three rows come out different from GNU diff:half_width + 3instead of column two. The two are the same at the default--width=130, so it only shows at other widths and with--expand-tabs.Tabs are shown as
^Iand line ends as$:GNU diff 3.10 prints:
So the change is confined to
process_half_lineandpush_output. Print only the text of each half, keep the column where the output stopped, and pad from that column to the marker and to column two.