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

Fix remapping keys to actions with "mustBeFirstKey", fixes #2216 #2117

Merged
merged 2 commits into from
Nov 9, 2017

Conversation

insidewhy
Copy link
Contributor

Fix #2116

@insidewhy insidewhy force-pushed the jp/2216 branch 3 times, most recently from 0f9c6eb to 3da94a4 Compare November 5, 2017 13:49
vimState.recordedState.getCurrentCommandWithoutCountPrefix().length - keysPressed.length >
0 &&
this.mustBeFirstKey
this.mustBeFirstKey &&
Copy link
Contributor Author

@insidewhy insidewhy Nov 5, 2017

Choose a reason for hiding this comment

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

Take advantage of short-circuit evaluation to avoid work, only 3 commands have mustBeFirstKey set.

@insidewhy
Copy link
Contributor Author

Simplified things a little.

@@ -901,8 +921,6 @@ export class ModeHandler implements vscode.Disposable {

if (result === KeypressState.NoPossibleMatch && !isPotentialRemapping) {
vimState.recordedState = new RecordedState();
vimState.recordedState.commandList = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No point in repeating the work of the constructor here.

@insidewhy
Copy link
Contributor Author

It might be simpler just to not add the remapped keys to recordedState.commandList but I don't know if that will have other implications.

@xconverge
Copy link
Member

looks good to me!

@insidewhy
Copy link
Contributor Author

So good you want to merge it 🌴 🛩 ✈️

@xconverge
Copy link
Member

ship it!

@xconverge xconverge merged commit d428c75 into VSCodeVim:master Nov 9, 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