Page 1 of 1

Indents for braces after Loop, if etc

Posted: 21 Jan 2021, 07:31
by DaveT1
FYI: a little tip I wish I'd known before:

I uses the GNU style for indenting and braces, eg:

Code: Select all

while (x == y)
  {
	something ();
	somethingelse ();
  }
On return after the while (or if, loop, etc), inserting one { means that AHKS will automatically insert the matching closing brace. But for me these are the wrong indent level (ie., at the same level as the preceeding command). So I spent like, forever, manually indenting these braces relative to the preceeding command.

Top tip - after the return, use Tab to indent to the next level and then type the opening {. AHKS adds the closing brace and puts both braces at my preferred indent level. :bravo:

Hope this is useful.