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

Keybinding for cursorWordPart* collides with moveEditorTo*Group #53671

Closed
JohnArcher opened this issue Jul 6, 2018 · 6 comments
Closed

Keybinding for cursorWordPart* collides with moveEditorTo*Group #53671

JohnArcher opened this issue Jul 6, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-wordnav Editor word navigation issues verified Verification succeeded
Milestone

Comments

@JohnArcher
Copy link

We have written the needed data
Issue Type: Bug

With the introduction of sub word navigation (thanks a lot) after upgrading from 1.24.x to 1.25.0 there is a conflict with the following keybindings:

  • "ctrl+alt+right" is mapped to "cursorWordPartRight" and "workbench.action.moveEditorToNextGroup"
  • "ctrl+alt+left" is mapped to "cursorWordPartStartLeft" and "workbench.action.moveEditorToPreviousGroup"

I know that the sub word nav commands are also bound to "when": "textInputFocus", but that does not work. While in editor has focus and cursor blinks, if I press "ctrl+alt+right" the editor is moved to next group, which is wrong.

Other commands like "ctrl+right" ("cursorWordEndRight") works like indented.

VS Code version: Code 1.25.0 (0f080e5, 2018-07-05T13:11:58.697Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz (8 x 1995)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled
Memory (System) 11.95GB (2.66GB free)
Process Argv D:\Programme\Microsoft VS Code\Code.exe H:\miju\Documents\Projekte\Webtool_dashboard\1.0\qtDashboard.code-workspace
Screen Reader no
VM 50%
Extensions (28)
Extension Author (truncated) Version
html-snippets abu 0.2.1
vscode-caniuse aga 0.5.0
vscode-icontheme-nomo-dark be5 1.3.5
vscode-log-viewer ber 0.5.1
vscode-eslint dba 1.4.12
tslint eg2 1.0.33
LogFileHighlighter emi 2.4.0
vscode-todo-plus fab 2.1.4
php-debug fel 1.12.3
php-intellisense fel 2.3.3
php-pack fel 1.0.1
JSDocTagComplete Hoo 0.0.2
phpcs ika 1.0.5
docthis joe 0.7.1
svn-scm joh 1.29.6
format-indent Kas 1.3.0
csstriggers kis 0.6.0
php-symbols lin 2.1.0
rainbow-csv mec 0.4.2
vscode-todo-parser min 1.9.1
typescript-javascript-grammar ms- 0.0.42
debugger-for-chrome msj 4.7.0
php-docblocker nei 1.6.0
vscode-paste-and-indent Rub 0.0.8
todotasks san 0.5.0
comment-snippets Tob 0.2.0
vscode-todo-highlight way 0.5.12
html-css-class-completion Zig 1.17.1

(2 theme extensions excluded)

@bpasero
Copy link
Member

bpasero commented Jul 6, 2018

These keybindings existed before grid (possibly a couple of years by now) so I think they should not be overwriting established keybindings.

@bpasero bpasero removed their assignment Jul 6, 2018
@vscodebot vscodebot bot removed the new release label Jul 10, 2018
@sonicdivx
Copy link

sonicdivx commented Jul 24, 2018

@bpasero Not sure understand your comment. Sub-Nav is new feature released on stable and conflicts. So someone needs to fix sub-nav keyboard shortcuts or update old keybindings to work with new features.

I am on Windows and this is a problem

@dan-blanchard
Copy link

dan-blanchard commented Jul 24, 2018

I've actually tried to fix the keybinding conflict and still find that sub-word navigation shortcuts don't work.

@sonicdivx
Copy link

I figured out the issue. Seems the keybindings are applied in order. I recreated the sub-nav keybindings in the User file and they superseded the Global bindings. That said, if you want both functions I think you either need to create different mappings or change the global items' "when" condition.

Unfortunately the VS docs are a bit cryptic, IMHO, on the different focuses. I mean editorFocus,textInputFocus read almost the same

@alexdima alexdima added the editor-wordnav Editor word navigation issues label Jul 30, 2018
@alexdima alexdima added this to the July 2018 milestone Jul 30, 2018
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Jul 31, 2018
@alexdima
Copy link
Member

alexdima commented Aug 3, 2018

I will remove the conflicting keybindings on Windows and Linux. If you wish to use sub-word navigation, you can define the following in the keybindings.json:

{ "key": "ctrl+alt+right",          "command": "cursorWordPartRight",
                                       "when": "textInputFocus" },
{ "key": "ctrl+shift+alt+right",    "command": "cursorWordPartRightSelect",
                                       "when": "textInputFocus" },
{ "key": "ctrl+alt+left",           "command": "cursorWordPartStartLeft",
                                       "when": "textInputFocus" },
{ "key": "ctrl+shift+alt+left",      "command": "cursorWordPartStartLeftSelect",
                                       "when": "textInputFocus" },
{ "key": "ctrl+alt+backspace",       "command": "deleteWordPartLeft",
                                       "when": "textInputFocus && !editorReadonly" },
{ "key": "ctrl+shift+alt+backspace", "command": "deleteWordPartRight",
                                       "when": "textInputFocus && !editorReadonly" },

This is also documented in the release notes

@roblourens roblourens added the verified Verification succeeded label Aug 3, 2018
@bleucitron
Copy link

Default key bindings for cursorWordStartLeft (and similar cursorWordEndRight, cursorWordEndRightSelect, cursorWordStartLeftSelect) actually conflict with default for cursorWordPartLeft and similar.

cursorWordStartLeft and similar should not have editorTextFocus default when IMHO.

I actually had to change the keybindings.json as follows to make it work properly:

    {
        "key": "ctrl+alt+left",
        "command": "-cursorWordStartLeft",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+alt+right",
        "command": "-cursorWordEndRight",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+right",
        "command": "-cursorWordEndRightSelect",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+left",
        "command": "-cursorWordStartLeftSelect",
        "when": "editorTextFocus"
    }

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-wordnav Editor word navigation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants