Sublime Forum

Translate "context" condition functionality from keybinding

#1

Here is a keybinding JSON:

    {
        "keys": "alt+,"]
    ,   "command": "move", "args": {"by": "characters", "forward": true}
    ,   "context": { "key": "preceding_text", "operator": "not_regex_contains", "operand": "^$", "match_all": true }]
    }

Here is a bit of Python code that runs the same command:

    run_command("move", {"by": "characters", "forward": True})

But how do I translate the “context” condition functionality from the keybinding JSON to the Python code?

0 Likes