Why is Uncrustify forcing a space before my Objective-C block closing brace?
Asked Answered
R

1

6

I'm having problems with my -rather extense- Uncrustify Configuration. I'm using Xcode to auto-run Uncrustify.

For some reason, Uncrustify seems to add a Space before the closing Brace of a block declaration.

Sample Input

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
 }];

Sample Output (note the forced space before the closing Brace)

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
  }];

Desired Output

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
 }];

How can I fix this?

Rhodia answered 26/3, 2014 at 14:21 Comment(0)
R
2

Ok, so I did find a solution for this.

I ended up using the following parameter in my uncrustify.cfg

indent_oc_block_msg_xcode_style = true

Got this tip by asking in the Source Forge project website (after a week or so).

Rhodia answered 7/4, 2014 at 14:34 Comment(1)
Can you link to where you asked this on the Source Force site? I can't seem to get it to work in my uncrustify.cfgEumenides

© 2022 - 2024 — McMap. All rights reserved.