Line breaks between function definitions

后端 未结 2 2010

Is there any way to to automatically insert spaces between function definitions. E.g. my initial sources are:

void
func1()
{
    // func1 body.
}
void
func2(         


        
相关标签:
2条回答
  • 2020-12-18 18:29

    As far as I can tell, there's currently no way to force clang-format to insert blank lines between consecutive functions where there currently are none. IMHO this is a huge missing feature.

    0 讨论(0)
  • 2020-12-18 18:46

    Your best bet is to set 'MaxEmptyLinesToKeep: 2' inside .clang-format file to let clang-format keep 2 lines intact.

    0 讨论(0)
提交回复
热议问题