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

Compare distance between cursor with absolute value. #4295

Merged
merged 6 commits into from
Sep 7, 2017
Merged

Conversation

asturur
Copy link
Member

@asturur asturur commented Sep 7, 2017

When cursor is after the end of line, we cannot use the calculation as if the cursor was between 2 chars.
The cursor is after both of them and so we need to compare the distance in absolute value.

@blobinabottle that should fix the cursor to next line.
(not tried yet)

@asturur
Copy link
Member Author

asturur commented Sep 7, 2017

Ok the Math.abs trick did not work.
If i explicitly check for the difference to be negative it works as expected.

@asturur asturur merged commit 0f26563 into master Sep 7, 2017
@asturur asturur deleted the fix-cursor-pos branch September 16, 2017 20:06
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

Successfully merging this pull request may close these issues.

1 participant