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

Add support for failed motions #466

Merged
merged 2 commits into from
Jul 17, 2016
Merged

Add support for failed motions #466

merged 2 commits into from
Jul 17, 2016

Conversation

johnfn
Copy link
Member

@johnfn johnfn commented Jul 17, 2016

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.

@johnfn johnfn merged commit 593573a into master Jul 17, 2016
}
// Make sure the start position is inside the selection

if (startPos.isAfter(position) || endPos.isBefore(position)) {
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah. Good catch.

Copy link
Member Author

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();
Copy link
Contributor

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.

Copy link
Member Author

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.

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