Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New text added is not marked as green #27

Open
abdielcs opened this issue Apr 2, 2020 · 1 comment
Open

New text added is not marked as green #27

abdielcs opened this issue Apr 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@abdielcs
Copy link
Contributor

abdielcs commented Apr 2, 2020

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

@jfcherng
Copy link
Owner

jfcherng commented Apr 3, 2020

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 jfcherng added wontfix This will not be worked on enhancement New feature or request and removed wontfix This will not be worked on labels Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants