macros
macros copied to clipboard
Feature Request: Control Structures
Is it possible to implement simple control structures to repeat a macro or a block inside a macro (or even a macro calling another macro) n-times or until end-of-line or end-of-file, for example?
Or allow full access to JavaScript. I currently have these macros:
"macros": {
"keyboardScrollDown": [
"cursorDown",
{
"command": "editorScroll",
"args": {
"to": "down",
"by": "line",
"revealCursor": true
}
}
],
"keyboardScrollUp": [
"cursorUp",
{
"command": "editorScroll",
"args": {
"to": "up",
"by": "line",
"revealCursor": true
}
}
]
}
with keybindings:
{
"key": "ctrl+down",
"command": "macros.keyboardScrollDown"
},
{
"key": "ctrl+up",
"command": "macros.keyboardScrollUp"
}
I'd like to be able to run the "cursorUp" and "cursorDown" conditionally, only if the cursor moves outside the window (to keep it inside the window while ctrl-scrolling). That would allow me to emulate Visual Studio and Sublime behaviour.
If we had access to JavaScript that would solve your request and mine as well, provided we can query all editor properties.