I think I'm making some progress. Here is what I've learned.
Indentation cannot be disabled. End of story. So there's that.
The most important setting is "Indent solo { by _ spaces". This has nothing to do with the "{" character. It affects every line.
There is a concept of indentation context. This is the "indent width" setting. It is the number of spaces after an opening "{" to indent the next line of code.
The "indent solo { by _ spaces" defines a negative indent from the indentation context.
So, if I want to code Objective-C in this style:
- (void) foo
{
handleValue(3);
if(YES)
{
handleValue(4);
}
}
I need an "Indent width" of 2 and an "indent solo { by _ spaces" of 2. They cancel each other out and my code lines up.
The indentation context in Swift is more complicated. At the top level, it works like Objective-C.
After the top level, Swift ignores the position of the opening brace. The context is defined in terms of the parent expression. if "indent width" and "indent solo {" are the same, then they cancel each other out and my subordinate block is indented at the same level as the parent, which is wrong in any language. In order to get my code to work (after the top level), I need to set "indent solo { by _ spaces" to zero. Luckily this field does accept zero. "Indent width" does not allow zero.
What this means for people dealing with leftward indent problems, you may be able to fix the problem by setting "indent solo { by _ spaces" to zero, but only in Objective-C/C++.
C++ seems to work like Swift's inner block logic. Set "indent solo { by _ spaces" to zero and it should fix it everywhere.
But alas, poor me. I waited ten years to switch to Swift, and I didn't wait long enough to iron out the daily bugs.