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

Custom binding doesn't trigger compound command #4928

Closed
tecfu opened this issue Jun 6, 2020 · 3 comments · Fixed by #4735
Closed

Custom binding doesn't trigger compound command #4928

tecfu opened this issue Jun 6, 2020 · 3 comments · Fixed by #4735

Comments

@tecfu
Copy link

tecfu commented Jun 6, 2020

Issue

I've mapped <leader>a to ^ in normal mode as follows:

"vim.normalModeKeyBindings": [
       {
            "before": ["<leader>", "a"],
            "after": ["^"]
        }
}

I expect pressing the sequence <leader>a to thus replicate the behavior of pressing ^ when in normal mode. It does. Except for when I use it in a compound command sequence. Like d<leader>a. Which does nothing.

Conversely, d^ will delete from the current cursor position to the beginning of the current line. This is what I expect <leader>a to do in normal mode after being bound to ^ in normal mode.

To Reproduce

  1. settings.json
"vim.normalModeKeyBindings": [
       {
            "before": ["<leader>", "a"],
            "after": ["^"]
        }
}
  1. Restart VSCode
  2. Open a file, move the cursor to the end of a line of text. Press the following sequence: d<leader>a
  3. Nothing happens

Expected behavior

After pressing sequence: d<leader>a, line should be deleted

Environment (please complete the following information):

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:22.494Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.0-53-generic / Xubuntu 18.04
VSCode Vim Version: 1.14.5

@berknam berknam mentioned this issue Jun 6, 2020
10 tasks
@berknam
Copy link
Contributor

berknam commented Jun 7, 2020

What you need here is operatorPendingMode remapping which isn't supported yet but is going to be fixed with PR #4735. If you can test that PR and give some feedback.

@tecfu
Copy link
Author

tecfu commented Jun 7, 2020

Thanks @berknam. Please see: #4735 (comment)

@tecfu
Copy link
Author

tecfu commented Jun 7, 2020

Resolved by PR #4735. Closing under assumption this PR will be merged.

@tecfu tecfu closed this as completed Jun 7, 2020
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