Indents for braces after Loop, if etc

Editor for AutoHotkey written completely in AutoHotkey.

Moderator: maestrith

DaveT1
Posts: 224
Joined: 07 Oct 2014, 11:23

Indents for braces after Loop, if etc

Post by DaveT1 » 21 Jan 2021, 07:31

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.

Return to “AHK Studio”