-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
jj
cursor position fix for #1418
#2366
Conversation
it tests that keys are replaced with correct keys, but that is not the case |
anyway, im using vim with my fix for 3 days now, everything is ok |
What is stopping us from merging this pr? |
+1 I'd love to see this merged in too. |
@prog666 Sorry, I didn't immediately merge this because I was confused what the error was (I think partially because the repro in the issue linked isn't related to the title of this PR). After playing around with it a bit though, I see what the issue was. LGTM! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @prog666. I'm on vacation so haven't been on top of these issues/PRs. I left a few comments.
src/common/motion/position.ts
Outdated
@@ -376,9 +376,9 @@ export class Position extends vscode.Position { | |||
* Gets the position one to the left of this position. Does not go up line | |||
* breaks. | |||
*/ | |||
public getLeft(): Position { | |||
public getLeft(count: number = 1): Position { | |||
if (!this.isLineBeginning()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this check to ensure that we don't go past the beginning of the line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no check for getRight()
src/common/motion/position.ts
Outdated
@@ -376,9 +376,9 @@ export class Position extends vscode.Position { | |||
* Gets the position one to the left of this position. Does not go up line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this comment.
@jpoon done |
On vacation in Africa at the moment. We'll be back to hotel tomorrow and I can take a look then. Otherwise @Chillee can merge assuming my comments were addressed. |
Looks like both of jpoon's comments have been addressed. I'm gonna merge this. Thanks! |
Which issue(s) this PR fixes
fixes #1418
Special notes for your reviewer: tried to make test, but tests are made in the way that
jj
not actually passed to editor.