As of today, Format Document has started removing all the indentation from lines that are “empty”. (lines that only have spaces / tab)
I use Format Document a lot in our teams’ projects as it helps maintain a level of consistency across the board. I believe this to be a bug, given that it’s started happening without any announcement and there is no setting to revert back to the previous behavior.
This is the behavior of the “Auto Clean Empty Line” setting in Script Editor settings. It defaults to true and removes whitespace on otherwise empty lines. If you don’t want this & instead you want Format Document to leave the existing tabs in the document on empty lines, you should be able to just uncheck that box in Studio Settings → Script Editor → Auto Clean Empty Line here.
That’s so odd! I haven’t reinstalled Studio or done anything that I can think of that would have reset the settings, but that does appear to be the case!
I totally missed that setting when looking around the Script Editor settings…