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

Keys specified in vim.handleKeys aren't being handled #2162

Closed
kmckelvin opened this issue Nov 20, 2017 · 13 comments · Fixed by #2267
Closed

Keys specified in vim.handleKeys aren't being handled #2162

kmckelvin opened this issue Nov 20, 2017 · 13 comments · Fixed by #2267

Comments

@kmckelvin
Copy link

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

Environment:

  • VSCode Version: 1.18.1
  • VsCodeVim Version: 0.10.4
  • OS: Linux (Ubuntu 17.10). Also experiencing it on macOS 10.13.1

What happened:

Using these configuration options:

    "vim.useCtrlKeys": false,
    "vim.handleKeys": {
        "<C-o>": true,
        "<C-i>": true,
        "<C-r>": true
    },

When using <C-o>, <C-i> or <C-r>, the keys are handled by VSCode. E.g. <C-o> displays the File Open dialog.

What did you expect to happen:

Using keys marked as true in the vim.handleKeys section should be handled as vim bindings. <C-o> and <C-i> should navigate the jump list. <C-r> should redo.

How to reproduce it:

Set useCtrlKeys to false, and handle specific key bindings

    "vim.useCtrlKeys": false,
    "vim.handleKeys": {
        "<C-o>": true,
        "<C-i>": true,
        "<C-r>": true
    },

Press <C-o>. The File Open dialog is shown.

I've confirmed this last worked in 0.10.2 by installing the vsix file. The behaviour breaks in 0.10.3.

@ghost
Copy link

ghost commented Jan 5, 2018

same issue here.

Environment

  • VSCode Version: 1.19.1
  • VsCodeVim Version: 0.10.7
  • OS: Windows 10, Version 1709, Build 16299.192

@jpoon
Copy link
Member

jpoon commented Jan 5, 2018

Ah, we're only handling the negation of handleKeys. Should be an easy fix.

@jpoon
Copy link
Member

jpoon commented Jan 5, 2018

Proposal: Remove useCtrlKeys altogether. The functionality of useCtrlKeys and handleKeys overlaps.

This will be a breaking change as people will need to update their configs, but the configuration of the keys will be more obvious.

@gwojan
Copy link

gwojan commented Jan 5, 2018

I have Normal mode Space mapped to Ctrl+f and Shift+Space mapped to Ctrl-b via Keyboard Shortcuts and this fix appears to break those mappings...

@jpoon
Copy link
Member

jpoon commented Jan 5, 2018

Can you share your user settings?

@gwojan
Copy link

gwojan commented Jan 5, 2018

@jpoon Sure... Included is settings.json and keybindings.json.

settings.zip

@jpoon
Copy link
Member

jpoon commented Jan 5, 2018

            "<C-F4": false,
            "<C-K": false,
            "<C-f": true,
            "<C-N": false

this is malformed.

@gwojan
Copy link

gwojan commented Jan 5, 2018

Care to elaborate? 😉 I figured as much, however, that really isn't my concern at the moment. the Space and Shift+Space mappings are pretty much muscle memory at this point...

@ghost
Copy link

ghost commented Jan 6, 2018

"vim.useCtrlKeys": false,
    "vim.handleKeys": {
        "<C-u>": true,
        "<C-d>": true,
        "<C-i>": true,
        "<C-o>": true,
        "<C-r>": true
}

After the fix yesterday everything else (in my use-case) works fine, except C-d
C-d behaves as default shortcut, "Add Selection To Next Find Match".
Delete this shortcut in keybindings.json doesn't help

    {
        "key": "ctrl+d",
        "command": "-editor.action.addSelectionToNextFindMatch",
        "when": "editorFocus"
    },

Sounds like a visual studio code issue?

But if make "vim.useCtrlKeys": true, C-d works great even without deleting the default shortcut.

Environment

  • VSCode Version: 1.19.1
  • VsCodeVim Version: 0.10.8
  • OS: Windows 10, Version 1709, Build 16299.192

@jpoon
Copy link
Member

jpoon commented Jan 6, 2018

It's likely this line (https://github.com/VSCodeVim/Vim/blob/master/src/mode/modeHandler.ts#L288), but it's not obvious to me right now why we had to remap it.

@jpoon
Copy link
Member

jpoon commented Jan 6, 2018

Interesting. The easiest thing would be to remove the key entirely. I don't use multi-cursor all that much so not sure if this would break a lot of people.

@ghost
Copy link

ghost commented Jan 6, 2018

You are right, the reason of that remapping is vague, I assumed it.

Yes, it's not logical to have useCtrlKeys and handleKeys working together, remove that useCtrlKeys is fine, but then users have to config every ctrl keys into handleKeys ( did it yesterday), a little bit inconvenient, some people just want to enable/disable several keys while leaving rest of keys unchanged.

Maybe rename useCtrlKeys to useCtlKeysByDefault? It sounds better, lol.

Also, I'm new to github, messing around everything resulting into these repeating commits, they are already being hard reset, but still appearing in this page, is there a way to remove these redundant commits, or make them disappear on this page?

@jpoon
Copy link
Member

jpoon commented Jan 10, 2018

Oops, sorry missed your comment. Yeah, agree that it might be a bit cumbersome to all those configs in. Let's leave it the way it is.

Maybe rename useCtrlKeys to useCtlKeysByDefault? It sounds better, lol.

No, that would unnecessarily break everybody's config.

My knowledge gap right now is why we needed the <D-d> remapping that you pointed out to in your PR.

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