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

There is strange logic in code #55

Open
shds86 opened this issue Sep 3, 2018 · 0 comments
Open

There is strange logic in code #55

shds86 opened this issue Sep 3, 2018 · 0 comments

Comments

@shds86
Copy link

shds86 commented Sep 3, 2018

When I use ace-diff I'm equaling it with diff-merge by TortoiseSVN or TortoiseGit and I think that the left side is previous version of code and the right side is mine or next version of code. So as I know diff_match_patch provides a method - diff_make(arg1, arg2), which finds difference between arg1 and arg2 which have need added to arg1 for getting arg2. But inside the ace-diff code I find the next lines

const dmp = new DiffMatchPatch();
const val1 = this.editors.left.ace.getSession().getValue();
const val2 = this.editors.right.ace.getSession().getValue();
const diff = dmp.diff_main(val2, val1);

Is It correct to use val2, from ace.right, like "text from", and val1, from ace.left, like "text to"?
Also diff_match_patch provides methods dmp.diff_text1(diffs) and dmp.diff_text2(diffs) the first one returns text from ace.right and the second one returns text from ace.left. It looks like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant