Gap after test statements in clang format

I use BreakBeforeBraces: Allmanin my file .clang-format, but the brackets in terms of control (eg if, for, while, ...) do not fit into their own line.

// Currently:
void foo()
{
    while(true) {
        bar();
    }
}

// What I want:
void foo()
{
    while(true) 
    {
        bar();
    }
}

I read that you can set nested configuration classes for curly braces in BraceWrapping, but I could not determine the correct YAML syntax (and JSON syntax for an exalted text plugin), and could not find any existing example.

Is there any way to do this?

+4
source share
1 answer
+3

Source: https://habr.com/ru/post/1609965/


All Articles