For the original issue, I can't reproduce this. What I'm doing is starting with an empty file, adding one function, and then typing the code you have in your post.
I suspect that adaptive formatting may be coming into play.
So, some questions:
- Can you reproduce it just adding your code to a function in an empty file?
- If you go to a file where you can reproduce the problem, if you run set-var def_beautifier_aff_bracestyle 0 in the command line, can you still reproduce the problem?
I can't get the else alignment problem in your last message to happen either. When I press return after the } of the if statement, my cursor ends up in the same column as the "if". I'll need to take a closer look at that, it doesn't strike me as something that adaptive formatting could tweak.
The indent problem in column 1 is an old limitation. If I remember right, it's easy to change, but requires a lot of unit test updates/additions to make sure it doesn't make any wheels fall off the wagon. I'll look again once we figure out the previous problems.