php-diff
php-diff copied to clipboard
New text added is not marked as green
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
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 \n
s) 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.