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

Fixes #1588: <C-a> does wrong things if cursor is to the right of a number (and there's a number on the next line) #1617

Merged
merged 3 commits into from
May 1, 2017

Conversation

Chillee
Copy link
Member

@Chillee Chillee commented May 1, 2017

Comes from a bug in the IterateWords helper function used. The function should stop at the end of the line, but since wordEnd() isn't at lineEnd(), it continues onto the next line and takes characters from there.

Fixes another small bug as well. Namely,

|-5
abcd

does not do right things.

return;
}
start = start.getWordRight();
wordEnd = start.getCurrentWordEnd();
wordEnd = start.getCurrentWordEnd(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah - we need to use more keyword arguments. e.g. i have no idea what this true means, but if it was start.getCurrentWordEnd({ exclusive: true }), that would be much better.

Not pertinent to this PR, but it's been on my mind.

@johnfn
Copy link
Member

johnfn commented May 1, 2017

LGTM. Thanks for the PR! :)

@johnfn johnfn merged commit 72c00f3 into VSCodeVim:master May 1, 2017
@Chillee
Copy link
Member Author

Chillee commented May 1, 2017

I think we also just need to comment and explain all of our functions haha.

@johnfn
Copy link
Member

johnfn commented May 1, 2017

That would help too. :) I like object arguments because they are like enforced comments.

@Chillee Chillee changed the title Fixes #1588 Fixes #1588: <C-a> does wrong things if cursor is to the right of a number (and there's a number on the next line) May 2, 2017
This pull request was closed.
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.

2 participants