Having studied the cursor position macros of PhraseExpress, TextExpander and Autohotkey, I think the following would be the most robust cursor positioning macro system (consistent with other macros we already have).
We've to support text block selection, absolute cursor positioning, cursor movement wrt end of snippet
Note: the current default behavior is to place the caret at the end of/highlighting the first placeholder the snippet. In case of implementing these macros, the caret can be placed at the macro afterall placeholders have been executed.
Warning: more than one such a macro shouldn't be used in a single snippet, because the caret can only be placed on the first one of them.
Syntax:
[x] Absolute caret position:[[%c]] or [[%c()]] - the cursor would be placed where ever this string occurs in the snippet
[x] Text block selection:[[%c(s)]] - denotes start of text block selection; [[%c(e)]] - denotes end.
[ ] Caret movements:[[%c(<all_symbols_without_space>)]]; ex: [[%c(v^4<3)]] results in down, then up four times, then left three times.
a. Supports left (<), right (>), up (^), down (v).
b. Numeric suffix n repeats the operation n times.
c. <1 is equivalent to <, and so on.
d. Warning: executes in sequential order, as contrast to TextExpander's reverse order.
Having studied the cursor position macros of PhraseExpress, TextExpander and Autohotkey, I think the following would be the most robust cursor positioning macro system (consistent with other macros we already have).
We've to support text block selection, absolute cursor positioning, cursor movement wrt end of snippet
Note: the current default behavior is to place the caret at the end of/highlighting the first placeholder the snippet. In case of implementing these macros, the caret can be placed at the macro after all placeholders have been executed.
Warning: more than one such a macro shouldn't be used in a single snippet, because the caret can only be placed on the first one of them.
Syntax:
[[%c]]
or[[%c()]]
- the cursor would be placed where ever this string occurs in the snippet[[%c(s)]]
- denotes start of text block selection;[[%c(e)]]
- denotes end.[[%c(<all_symbols_without_space>)]]
; ex:[[%c(v^4<3)]]
results in down, then up four times, then left three times. a. Supports left (<
), right (>
), up (^
), down (v
). b. Numeric suffixn
repeats the operationn
times. c.<1
is equivalent to<
, and so on. d. Warning: executes in sequential order, as contrast to TextExpander's reverse order.