Sublime Forum

Recursive macro

#1

Hello everyone,
I would like to know if it is possible do make a recursive macro with Sublime text 3.
I usually make macros with the “Tools” -> “Record Macro” button (or Ctrl + A) but it seems it’s impossible to create a macro that calls itself. If someone can tell me how to do a macro that calls another macro (like functions), I would be grateful.
Cordially.

0 Likes

#2

Macros can record other macros executing; there are a few default key bindings that are implemented with macros, for example. All you should have to do is invoke the macro while you’re recording. You can also manually create/edit sublime-macro files as well.

However, macros continue to execute until they run out of commands; they don’t for example decide to stop because you tried to move the cursor down a line but there are no more lines.

As such, recursive macros are not supported in the sense that once you start one going, it will continue to run forever, which hard locks Sublime and may cause memory usage to spiral wildly out of control, depending on what the Macro was trying to do.

0 Likes