I only finally figured this out yesterday, after going through my AHK queries text file,
I was going to report it as a bug, but did some double-checking on the forums to be sure:
'why is leading whitespace in a (non-expression) continuation section removed?'
I found:
Continuation sections, left tabs in the first line - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/1047 ... irst-line/
it was also the first time I realised you could do an expression mode continuation section (':=' style)
Code: Select all
vText1 =
(
1
2
3
)
vText2 =
(
`t1
2
3
)
vText3 =
(
%A_Tab%1
2
3
)
imagine the continuation section was 'unfolded' into one line
Code: Select all
vText1 = 1`n 2`n 3
vText2 = `t1`n 2`n 3
vText3 = %A_Tab%1`n 2`n 3
clearly in vText1 you would lose the tab, because it is a literal tab typed by the keyboard
(in non-expression mode leading/trailing literal whitespace is always removed, whether AutoTrim is off or on)
(literal: when it was typed as invisible characters you can't see rather than say `t, %A_Space%, %A_Tab%)
but in vText2 and vText3 the leading tab is kept
if you did
Code: Select all
AutoTrim, On
vText2 = %vText2%
vText3 = %vText3%
then vText2 and vText3 would now lose the leading tab