Closed shankarswamy closed 6 years ago
The idea of a macro is that you record and sequence of operations and then you replay it on demand. So you could certainly record one to do what you're after, but it won't be called automatically as you press ENTER (code might be able to be modified for that, but that cannot go into the main release as it would be way too invasive).
Instead, you could call your macro via a key binding. Currently, there is limited support to bind shortcuts to macros (see https://github.com/xps/VSTextMacros/issues/7), but this could definitely be improved.
I am wondering if it is feasible to add the following feature to the macros, and if yes, some directions on how to modify the code to do it.
Way I type: while (xyze <= abcdef)
and hit return, I would like to see this:
while (xyze <= abcdef) {
} // while (xyze <= abcdef)
That is, the macro will copy the clause inside the while and add that as a comment after the brace close. Ditto for if, for etc and similar things.
Thanks!