Sublime Forum

Help with keybinding ("last_command")

#1

I want to specify the context under which my keybinding is to be run.

This works:
{ "key": "last_command", "operator": "equal", "operand": "move", "by": "words", "forward": true }

This does not:

{ "key": "last_command", "operator": "equal", "operand": "run_macro_file", "file": "res://Packages/User/macros/move_forward.sublime-macro" }

Why and where is my formatting wrong?

Please note I need the arguments after the “run_macro_file”.

0 Likes

#2

I’ve never heard of a last_command key. Is this provided by ST itself or by a third-party plugin?

Either way, contexts only accept a single “operand” to compare against. Any further keys of the mapping are ignored.

See also http://docs.sublimetext.info/en/latest/reference/key_bindings.html#structure-of-a-context.

0 Likes

#3

ST itself in core provides this

0 Likes

#4

Darn! Too bad only one operand is supported.

0 Likes