-
Notifications
You must be signed in to change notification settings - Fork 101
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
Strange lines get inserted in the wrong place or diff computed wrong #28
Comments
I think I know how to fix, but I’m currently travelling so I could get to it in a few days. Possibly related to #1 |
hmm. nope. that didnt fix the issue. I still get a new difference after copying. It's like it's not initially detecting the blank line as a difference and then once the first difference is resolved then it detects it as a difference. Maybe something to do with the diff simplifier? |
Still travelling, but managed to create the smallest possible repro:
and
I will be looking into why this is happening. Pushed the branch here for now https://github.com/ace-diff/ace-diff/tree/JackuB/merge-with-newlines |
The issue is with newlines - if you look at the raw output from https://github.com/JackuB/diff-match-patch there is If you manually move the I think it might be related to this behaviour: Lines 494 to 497 in 42b957e
|
any idea what the solution might be?
…On Thu, Apr 19, 2018 at 8:55 AM, Jakub Mikulas ***@***.***> wrote:
The issue is with newlines - if you look at the raw output from
https://github.com/JackuB/diff-match-patch there is \nend (0 means no
change, so it's not part of the patch that's applied)
[image: snimek obrazovky 2018-04-19 v 17 04 16]
<https://user-images.githubusercontent.com/1788727/39003140-878fa57a-43fa-11e8-9e75-747c09910491.png>
If you manually move the \n to the previous line 42b957e
<42b957e>
it would fix the diffing, as now the newline will be part of the patch.
[image: 2018-04-19 17_52_12]
<https://user-images.githubusercontent.com/1788727/39003244-be0efde4-43fa-11e8-89c9-31cb7f4a2ddc.gif>
I think it might be related to this behaviour:
https://github.com/ace-diff/ace-diff/blob/42b957ee183c614494a614d836f8c8
ed1b49d411/src/index.js#L494-L497
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATV__HlfHRp2sUwkH9IJta7ap8rIittks5tqLN9gaJpZM4SQOWp>
.
|
Im not sure what is causing the issue, but ive seen several cases where doing a copy actually results in new differences. ive attached two files that you can paste into the respective editors. copy the difference in the fileb side to the filea side and you'll see a new difference is then created for the blank line after the original difference. Not sure if this is line ending related or diff related?
fileb.txt
filea.txt
The text was updated successfully, but these errors were encountered: