-
-
Notifications
You must be signed in to change notification settings - Fork 196
DiffRowGenerator returns too many diffs in special cases #65
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
Comments
You are diffing sortedRemovals and sortedAdditons? How do you know, that there should be 2 diffs? |
Well it should diff the 2 pairs hence it should return 2 DiffRows but it returns 3 instead :/ |
Sorry missread diffrows as diffs. You are right, that the rowcount should be the same, but there could be multiple diff in one line. That was my fault. However now I can reproduce your problem. |
After digging into this I find it I am not yet quit sure how to solve this. The diff result is correct. The problem is, that something without linefeed is replaced by something with linefeed and the linefeed that remains is replaced by another delta. |
So here is the first try to at least optionally try to fix this. There is a new method in the builder (replaceOriginalLinefeedInChangesWithSpaces) to switch this on. So could you give it a try? |
Describe the bug
DiffRowGenerator returns too many diffs in special cases.
To Reproduce
Steps to reproduce the behavior:
sortedRemovals:
["Ich möchte nicht mit einem Bot sprechen.", "Ich soll das schon wieder wiederholen?"]
sortedAdditions:
["Ich möchte nicht mehr mit dir sprechen. Leite mich weiter.", "Kannst du mich zum Kundendienst weiterleiten?"]
Expected behavior
diffRows should have size 2 but it has size 3.
System
Setting inlineDiffByWord(true) does not produce the error.
The text was updated successfully, but these errors were encountered: