-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Closed
Closed
Copy link
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugkeybindingsVS Code keybinding issuesVS Code keybinding issuesregressionSomething that used to work is now brokenSomething that used to work is now brokenverifiedVerification succeededVerification succeeded
Milestone
Description
Issue Type: Bug
I think this changed somwhere in January (I don't think I've noticed it in late December).
Steps to repoduce:
- Open Keyboard Shortcuts editor
- Find shortcut without
whenexpression (e.g.workbench.action.closeActiveEditor) - Right click and select "Change When Expression"
- Add
whenexpression (e.g.editorTextFocus) and save it - Shortcut is removed from filtered results and doesn't work when cursor is in editor.
Root cause is that Change When Expression creates 2 records in keybindings.json:
{
"key": "ctrl+w",
"command": "workbench.action.closeActiveEditor",
"when": "editorTextFocus"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeActiveEditor"
}and lately "command": "-commandIdЭ without when removes all keybindings without taking when into account.
Swithing order of these objects restores expected behavior.
Looks like this doesn't happen if keybinding already had when expression. For example next change displayed in list as expected
{
"key": "escape",
"command": "editor.debug.action.closeExceptionWidget",
"when": "exceptionWidgetVisible && editorTextFocus"
},
{
"key": "escape",
"command": "-editor.debug.action.closeExceptionWidget",
"when": "exceptionWidgetVisible"
},VS Code version: Code - Insiders 1.64.0-insider (3dda6ea, 2022-01-27T05:15:00.564Z)
OS version: Windows_NT x64 10.0.19041
Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 31.72GB (20.14GB free) |
| Process Argv | --crash-reporter-id cf52dbde-2c94-45c3-9bf3-45d8b9966b04 |
| Screen Reader | no |
| VM | 0% |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugkeybindingsVS Code keybinding issuesVS Code keybinding issuesregressionSomething that used to work is now brokenSomething that used to work is now brokenverifiedVerification succeededVerification succeeded