-
-
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
Add support for failed motions #466
Conversation
} | ||
// Make sure the start position is inside the selection | ||
|
||
if (startPos.isAfter(position) || endPos.isBefore(position)) { |
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.
We can remove this now, right?
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.
Oh yeah. Good catch.
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.
Fixed on master, thanks!
@@ -707,6 +707,10 @@ export class ModeHandler implements vscode.Disposable { | |||
if (result instanceof Position) { | |||
vimState.cursorPosition = result; | |||
} else if (isIMovement(result)) { | |||
if (result.failed) { | |||
vimState.recordedState = new RecordedState(); |
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.
I believe this is the line that is causing #474, since the stacktrace we're getting is coming from modeHandler.ts
:
if (!recordedState.operator) {
throw new Error("what in god's name");
}
But more guessing than actually understanding what "recorded state" is.
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.
Yeah, sorry, RecorededState is an awful name! It used to be called ActionState, which was a little better, but still bad.
It's always a pleasant thing when a change that seems tricky ends up being very simple. 😃
Fixes a bug I promised @sectioneight I'd get to where ci{ when you're not inside {} would cause you to switch into insert mode. Also fixes an old bug where dtx when x couldn't be found would delete a character.