Open
Description
Currently, it seems that 'when' clauses in keybindings are associated with an entire keybinding rather than the individual commands within it. I suggest associating when
clauses with commands so that it would be possible in a keybinding with multiple commands to have separate when
clauses for each, and whether each command is run in a particular instance depends on whether its respective when
clause is fulfilled.
So a keybinding would look something like:
{
"key": "key",
"command": "runCommands",
"args": {
"commands": [
{
"command": "command1",
"args": {
"arg1": "value1",
"arg2": "value2"
},
"when": "condition1"
},
{
"command": "command2",
"when": "condition2"
},
{
"command": "command3",
"when": "condition3",
},
]
}
}
so upon pressing key
, if only condition2
is fulfilled and not condition1
and condition3
, then only command2
gets run, and if condition1
and condition2
are both fulfilled and not condition3
, then command1
gets run, and then command2
gets run (i.e. sequentially as usual), etc.