-
-
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
Fix remapping keys to actions with "mustBeFirstKey", fixes #2216 #2117
Conversation
0f9c6eb
to
3da94a4
Compare
vimState.recordedState.getCurrentCommandWithoutCountPrefix().length - keysPressed.length > | ||
0 && | ||
this.mustBeFirstKey | ||
this.mustBeFirstKey && |
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.
Take advantage of short-circuit evaluation to avoid work, only 3 commands have mustBeFirstKey
set.
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 = []; |
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.
No point in repeating the work of the constructor here.
It might be simpler just to not add the remapped keys to |
looks good to me! |
So good you want to merge it 🌴 🛩 |
ship it! |
Fix #2116