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

Keyslice mappings do not work with ";" #4057

Closed
braddotcoffee opened this issue Sep 8, 2019 · 1 comment · Fixed by #4735
Closed

Keyslice mappings do not work with ";" #4057

braddotcoffee opened this issue Sep 8, 2019 · 1 comment · Fixed by #4735

Comments

@braddotcoffee
Copy link

Describe the bug
I am currently attempting to remap ";;" to call a command. With other combination-based keybindings, the key mapper debugger indicates that a "key slice" is attempted to be matched for:

ModeHandler: debug: handling key=t.
index.js:30
Remapper: debug: trying to find matching remap. keys=t. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=t. keySlice=t.
index.js:30
Remapper: debug: trying to find matching remap. keys=t. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
index.js:30
ModeHandler: debug: handling key=t.
index.js:30
Remapper: debug: trying to find matching remap. keys=t,t. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=t,t. keySlice=tt.
index.js:30
Remapper: debug: normalModeKeyBindingsMap. match found. before=t,t. after=undefined. command=[object Object].

For the semicolon key, however, this is not the case:

ModeHandler: debug: handling key=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=;. keySlice=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
index.js:30
ModeHandler: debug: handling key=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=;. keySlice=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.

Conversely if you instead remap leader to ";", then remap to "", all works correctly:

Remapper: debug: trying to find matching remap. keys=j. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
index.js:30
ModeHandler: debug: handling key=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=;. keySlice=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
index.js:30
ModeHandler: debug: handling key=;.
index.js:30
Remapper: debug: trying to find matching remap. keys=;,;. mode=Normal. keybindings=normalModeKeyBindingsMap.
index.js:30
Remapper: verbose: key=;,;. keySlice=;;.
index.js:30
Remapper: debug: normalModeKeyBindingsMap. match found. before=;,;. after=undefined. command=[object Object].

To Reproduce
Steps to reproduce the behavior:

  1. Set "vim.debug.loggingLevelForConsole": "debug"
  2. Create a keybinding for ";;":
"before": [
    ";",
    ";"
],
"commands": [
    "workbench.action.quickOpen"
]
  1. Save and execute keybinding - quickOpen does not execute
  2. Set "vim.leader": ";"
  3. Remap keybinding:
"before": [
    "<leader>",
    "<leader>"
],
"commands": [
    "workbench.action.quickOpen"
]
  1. Save and execute keybinding - quickOpen executes

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.38.0
  • VSCode version: 1.10.2
  • OS: Mac OSX 10.14.5

Thanks!

@sluongng
Copy link

sluongng commented Sep 24, 2019

This is something I am having issue with as well.

I use ; as leader and use f + -> (repeat with ;) a lot.

Right now if i map ; as leader, the repeat does not work, thus I needed to rebind leader back to \

Hope that this will get resolved soon.

@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants