php-diff icon indicating copy to clipboard operation
php-diff copied to clipboard

New text added is not marked as green

Open abdielcs opened this issue 4 years ago • 1 comments

old file: X new file: XY z As the result in demo.php the new text added is not marked as green. old_file.txt new_file.txt PHP 7.4.1 , php-diff v6.6.4 Only work on Combined Diff php-diff

abdielcs avatar Apr 02 '20 22:04 abdielcs

Github and many softwares behave like that as well. https://gist.github.com/jfcherng/96c7297ebef871e17ca87514c58646b7/revisions#diff-1a79a4d60de6718e8e5b326e338ae533

It's expected result. Unless there are the same amounts of ins/del lines, we don't further find their corresponding lines.

Combined renderer doesn't provide line number information so it just treat them like a single line (which just has some \ns) and then mark detailed diff.


But I am fine that if someone is going to make a PR for this. There is maybe-helpful implementation of the Combined renderer.

jfcherng avatar Apr 03 '20 04:04 jfcherng