Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 864
Goles Avatar asked Nov 02 '22 02:11

Goles


1 Answers

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).

like image 172
Goles Avatar answered Nov 08 '22 04:11

Goles