I'm trying to create a macro to quickly enter two matching braces {}
with an empty line in between that has the deeper indentation.
My current macro performs this sequence:
This works fine, and returns the expected brace-pair and indentation between them:
{
}
But with nested brackets, the closing } has no indentation:
{
{
} <--
}
How to overcome this?
You could duplicate the indent that was already made to two new lines, using the "duplicate selection" command, usually mapped to Ctrl+D, but check your mapped key in Settings > Shortcut Mapper:
The key sequence would be:
This will also work as expected when there is already text on the current line.