-
-
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
Delaying input for multi-key combinations #3082
Comments
Minor note that this sounds similar to what I mentioned (but didn't handle) in #3081. We do have some sort of timeout logic in the app (see: As you mention, standard Vim will usually delay insertion if it knows that there is a potential mapping with additional keys. I'm assuming the expected behavior would be feasible without too much change, but I'd have to investigate further. |
Chiming in here to see if any discovery was made towards this issue. I also remapped my keys similarly. The character insertion ends up in the history buffer which makes undo'ing actions noisy. 😞 |
I've looked through the code and I think I found a possible solution to this problem. Basically the character after the cursor would be overridden by the current key if the Every consecutive character would also override the character right after the cursor and move back the cursor by one step. So, for example, three-letter mappings such as abc to would be Failed remappings should be like To implement this, I think Then the first part of the And there could be another function somewhere called What I would have implemented it myself, but the only thing is that |
This is a pretty massive change; see pull request #4735 for full details Most notably: - Support for operator-pending mode, including remaps and a half-cursor decoration - Correct handling of ambiguous remaps with timeout - Correct handling of recursive special case when the RHS starts with the LHS - Correct handling of multi-key remaps in insert mode - Failed movements that occur partway through a remap stop & discard the rest of the remap - Implement `unmap` and `mapclear` in .vimrc Refs #463, refs #4908 Fixes #1261, fixes #1398, fixes #1579, fixes #1821, fixes #1835 Fixes #1870, fixes #1883, fixes #2041, fixes #2234, fixes #2466 Fixes #2897, fixes #2955, fixes #2975, fixes #3082, fixes #3086 Fixes #3171, fixes #3373, fixes #3413, fixes #3742, fixes #3768 Fixes #3988, fixes #4057, fixes #4118, fixes #4236, fixes #4353 Fixes #4464, fixes #4530, fixes #4532, fixes #4563, fixes #4674 Fixes #4756, fixes #4883, fixes #4928, fixes #4991, fixes #5016 Fixes #5057, fixes #5067, fixes #5084, fixes #5125
Is your feature request related to a problem? Please describe.
I'm always frustrated when I type part of a key combination and the line moves along with the first key. For example, I have remapped jk to and the editor would always type out the j, deleting it after I type the k.
Describe the solution you'd like
The solution by NeoVim is to replace the next character with the character you're typing, and inserting the character after it times out. Personally, I find it to be a much cleaner solution.
Describe alternatives you've considered
I have no idea for the possibility for this feature, but just delaying the actual insertion for the key would be enough.
Additional context
What VSCode does
What VSCode should do
The text was updated successfully, but these errors were encountered: