Upcoming changes to keymap.json #34570
Replies: 2 comments
-
|
I'm not bothered with the syntax of binding to null. It just needs badly to change what it means. I would have thought that it makes it appear like the key binding does not exist(given that I bound it in the same context as the default binding) but instead it seems to bind to a |
Beta Was this translation helpful? Give feedback.
-
|
I do hope this means that we will get the ability to bind to a sequences of actions soo. Although how it works exactly should be discussed. For example are tasks run parallel or sequentially. Is it required that action 1 succeeds before action 2 runs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Keymap JSON changes
The current keymap JSON suffers from a few notable deficiencies:
Over the next few releases we hope to fix these similarly to how it's described below. For some changes we should be able to automatically migrate your keymap file, but for others (particularly tweaks to the context) we may need to leave things as is. Luckily we don't expect the context changes to do anything except fix existing broken keymaps.
Arguments
To fix the arguments we should use JSON object syntax instead of array syntax:
For actions with named arguments, the advantage is clearer:
Mappings
I added the workspace::SendKeystrokes action as a way to map from one key sequence to another. This feature is common enough that it should get its own syntax:
We might want to consider a deeper change here, but assuming we want to keep roughly the model we have today, it’s necessary to fix a few things:
Disabling
I'm less sure how to fix this. Today you can disable a binding in a matching context by assigning it to
null. However, this isn't always sufficient to do what you want. (c.f. #20167).Cases that don't seem to work well today:
cx.propagate(). For example if you wantctrl-gto act as escape in the editor, you can't because escape calls cx.propagate() which means thatctrl-gwill still act as go-to-line.One option would be to make disabling about the action(s) you don't want to happen instead of the key-binding:
Open to more ideas here though!
Beta Was this translation helpful? Give feedback.
All reactions