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

Can't remap to a sequence of keys that includes an i letter on the after part #4530

Closed
danielo515 opened this issue Jan 31, 2020 · 2 comments · Fixed by #4735
Closed

Can't remap to a sequence of keys that includes an i letter on the after part #4530

danielo515 opened this issue Jan 31, 2020 · 2 comments · Fixed by #4735

Comments

@danielo515
Copy link

danielo515 commented Jan 31, 2020

Describe the bug
Hello.
I'm trying to remap a leader+b combination to a sequence of keys. The problem is that, some of those keys include commands that are context aware and that depend on the previous key. Seems that the plugin is not able to "remember" the previous letter and just treats each one in isolation, so if you after sequence includes an i it will put it in insert mode, no matter you previously have an y

To Reproduce
You can try this remap

"before": ["leader","b"], 
"after": ["m","b","`","a", "y", "i", "w", "`", "b", "v", "i", "w", "p", "`", "a", "v", "i", "w", "p", "`", "b" ]

Expected behavior
I want it to execute the keys as a sequence, not each key individually

Screenshots

instead what you get is yiw... etc because the first a

Environment (please complete the following information):

Extension version: 1.12.4
VS Code version: Code 1.41.1 (26076a4de974ead31f97692a0d32f90d735645c0, 2019-12-18T14:57:51.166Z)
OS version: Darwin x64 19.2.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz (12 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 3, 3
Memory (System) 32.00GB (1.40GB free)
Process Argv
Screen Reader no
VM 0%

Additional context

@danielo515
Copy link
Author

Funnily, if I change the order it works. This sequence works fine:

      "after": ["m","b","`","a","y","i","w","`","b","v","i","w","p","`","a","v","i","w","p","`","b"]

@berknam
Copy link
Contributor

berknam commented May 29, 2020

Both sequences you gave are the same. This works fine if you already have the 'a' mark set. If the 'a' mark is not set it will give the error 'E20: Mark not set' and then it should stop the remapping but currently it doesn't stop so it continues with 'a' being AppendAtCursor and then appends the rest of the keys to the buffer.
This will be fixed on PR #4735.

@berknam berknam mentioned this issue May 29, 2020
10 tasks
J-Fields pushed a commit that referenced this issue Aug 16, 2020
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
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 a pull request may close this issue.

2 participants