-
-
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
Perform remapped commands when prefix by a number #1359
Conversation
Not ignoring this, just waiting for some time to properly review it... |
Sure, no worries take the time you need for this. |
The main thing that I don't understand about this PR is that we now appear to be doing remapping in two different places. One in First off, does this assessment sound correct to you? Second off, if that is true, then do you think you could make this PR such that all remapping happens in |
@johnfn, yes, that sounds correct to me. The thing that stopped me from implementing the feature in modeHandler.ts, is the limitation that the command has to be 1 char long. That basically means that it's already too late for remapping '2s' for instance. I will try to move the mapping to happen in getRelevantAction instead, and make an update. |
Thanks, @bdauria! If you have any trouble, feel free to ping me on Slack. |
This reverts commit 92b0db214ad961033e039caf26ec1f586931f311.
This reverts commit d13a0a842ba5785ba78df031b8aefdb26459a772.
@johnfn I've pushed some changes. I basically reverted all the changes from the original PR and made the fix in ModeHandler instead. as we discussed, moving the remapping part to getRelevantActions() would to big of a refactoring so not really in the scope of this PR. |
Awesome. Thanks for the great work, @bdauria! |
This PR allows remapped commands to perform correctly when prefixed by a count.
The modified code makes sure that only the command uses its remapped version, and not the following text objects.
For instance, if the command l is remapped to c, and w to é performing: 2liw will still be translated to 2ciw and not 2cié (this is the current behaviour for normal, non-count commands).
The code uses keymappings defined in otherModesNonRecursive. Should recursive mappings be supported in this case as well ?
This should close the following issue: #1233