perreal
perreal

Reputation: 98118

Double newlines following function definitions

Is it possible to use clang-format to have double newlines between function definitions:

void func1() 
{
    return;
}


void func2() 
{
    return;
}

Upvotes: 2

Views: 344

Answers (2)

Pradhan
Pradhan

Reputation: 16777

clang-format does not have an option controlling the number of newlines after the function definition. However, it does have an option, MaxEmptyLinesToKeep, which will keep it from undoing your two empty lines. So, you will have to cook up some way of doing this through your editor and clang-format with MaxEmptyLinesToKeep set to 2, or higher, will respect your decision.

Upvotes: 1

David McElhaney
David McElhaney

Reputation: 77

If you are asking whether the IDE can insert these lines automatically, I don't believe so. You can have any number of lines but only by manually entering them.

Upvotes: 0

Related Questions