oli-obk / prettydiff

Side-by-side diff for two files
MIT License
33 stars 16 forks source link

return diffs only #12

Closed iraizo closed 1 year ago

iraizo commented 2 years ago

Is there a way I can only print diff_lines if theres an actual diff?

mwcz commented 2 years ago

I was just looking for this too. The InlineChangeset::diff function looks promising, but I haven't tried it yet.

mwcz commented 2 years ago

Actually, set_diff_only is the way.

jiacai2050 commented 1 year ago

set_diff_only only works for side-by-side diff, not used in format, I prefer to apply in format too, since equal lines are quite verbose.

Also, I find SliceChangeset will display equal line like skip(N), it's best LineChangeset follow this style, but include line numbers. I will submit a PR to add this feature soon.