I have this code:
dispatch_async(dispatch_get_main_queue(), ^{
if (self.adAppearBlockIsAnimated) {
[UIView animateWithDuration:kAnimationTime animations:^{
self.adAppearBlock();
}];
}
});
Unfortunately, Uncrustify makes it look like:
dispatch_async(dispatch_get_main_queue(), ^{
if (self.adAppearBlockIsAnimated) {
[UIView animateWithDuration:kAnimationTime animations:^{
self.adAppearBlock();
}];
}
});
My config:
indent_oc_block=true
indent_oc_block_msg = 0
Does anyone know how to make it look normal? Without extra spaces in nested block.
EDIT: I cannot comment now, I am using xCode.
It appears that this a bug in Uncrustify itself; you can't necessarily work around it with a config change.
See:
https://github.com/bengardner/uncrustify/issues/68
(Personally, I'm a big fan of turning on "tab always indents", then selecting all, hitting and living with whatever Xcode produces. By having a standard set of formatting defaults for our team, anyone on the team can do this and not generate a bunch of spurious diffs when committing code.)