简体   繁体   中英

clang-format: empty line before and after control statements

Is there any possibility to achieve inserting an empty line before and after control statemets (for, if etc.)?

Eg I have the following source code:

if(bCondition)
{
    // some code
}
for(int i : vecOfInts)
{
    // some code
}
if(bAnotherCondition)
{
    // some code
}

and this is what I want:

if(bCondition)
{
    // some code
}

for(int i : vecOfInts)
{
    // some code
}

if(bAnotherCondition)
{
    // some code
}

Reading the official documentation, https://clang.llvm.org/docs/ClangFormatStyleOptions.html , there seems to be no such option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM