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

Diff not computed correctly if the text lines end with \r\n #1

Closed
AlexandraColdea opened this issue Apr 7, 2015 · 3 comments
Closed

Comments

@AlexandraColdea
Copy link

If you populate the editors with content that has both the CR and LF characters at the end of each line (for example, importing a file from a Linux environment), the diff is not computed correctly.

I suspect that it's the way the line lengths are computed in this method: getLineLengths.

Here is an example of how it behaves in this case:
screen shot 2015-04-07 at 09 33 22

@benkeen
Copy link
Member

benkeen commented Apr 8, 2015

Thanks, @AlexandraColdea! I'll try to look at that this weekend.

@benkeen
Copy link
Member

benkeen commented Apr 14, 2015

Sorry - I didn't manage to look at this yet. I'll try this week.

@cd8
Copy link

cd8 commented Jul 31, 2017

You can use .replace(/\n/mg, "") to make this work as it removes the additional \n

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

3 participants