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

mapping control-something to escape in insert doesn't work #4062

Closed
kyazdani42 opened this issue Sep 10, 2019 · 1 comment
Closed

mapping control-something to escape in insert doesn't work #4062

kyazdani42 opened this issue Sep 10, 2019 · 1 comment

Comments

@kyazdani42
Copy link
Contributor

kyazdani42 commented Sep 10, 2019

Describe the bug
Hi,
in insert mode, mapping C-something to Esc doesn't work properly.
when typing, you need to wait for 1/2 seconds before pressing the keys, else it produces an output like that:

Remapper: debug: trying to find matching remap. keys=a,<C-j>,<C-j>,<C-j>,<C-j>,<C-j>,<C-j>,<C-j>,<C-j>,<C-j>. mode=Insert. keybindings=insertModeKeyBindingsMap.

and cannot match the appropriate behavior. Tested with <C-j> and <C-e>
<C-c> and <C-[> work fine though. It also works perfectly in visual mode

To Reproduce
in settings.json:

{
    "keyboard.dispatch": "keyCode",
    "vim.debug.loggingLevelForConsole": "debug",
    "vim.insertModeKeyBindings": [
        {
            "before": ["<c-j>"],
            "after": ["<Esc>"]
        }
    ],
    "vim.visualModeKeyBindings": [
        {
            "before": ["<c-j>"],
            "after": ["<Esc>"]
        }
    ]
}

Expected behavior
mapping c-something to escape in insert mode should properly be detected

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.10.2
  • VSCode version: 1.38.0
  • OS: Linux 5.2.11-1-MANJARO x86_64
  • I also use Xmodmap to map caps lock to control but that shouldn't affect this as it worked fine with mapping caps lock to escape before
@kyazdani42
Copy link
Contributor Author

duplicate of #3530

J-Fields pushed a commit that referenced this issue Oct 27, 2019
There is an issue in insert modes with key mappings not working properly.
When typing, keymaps are just not recognized.

This PR tries to fix this by resetting the keys buffer on insert mode if the mapping didn't seem to be a potential remap.

Fixes #3221, fixes #3530, fixes #4062
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

No branches or pull requests

1 participant