How to get clang-format to not remove trailing newline for function call?

418 views Asked by At

Currently I'm using a version of this config, which is the closest I can find to idiomatic Obj-C formatting. However, it breaks the following convention, which is irritating enough to prevent me from turning on clang-format automatically:

@import AppKit;

int main() {
    // How can I get clang-format to respect this style?
    CGRect rect = CGRectMake(
        0.f,
        0.f,
        100.f,
        200.f
    );

    NSLog(@"%@", NSStringFromRect(NSRectFromCGRect(rect)));
}

Translates into:

@import AppKit;

int main() {
    // Right now it's formatted like this, which I do not want.
    CGRect rect = CGRectMake(
        0.f,
        0.f,
        100.f,
        200.f);

    NSLog(@"%@", NSStringFromRect(NSRectFromCGRect(rect)));
}

Is it possible to fix this?

0

There are 0 answers