访问后的Clang换行符修改器

时间:2019-03-14 18:45:39

标签: c++ class clang-format

在访问修饰符后找不到换行行为的配置。 (但未将MaxEmptyLinesToKeep设置为0) (要在访问修饰符更改后删除换行符) 我当前的clang配置如下:

Language: Cpp
CompactNamespaces: false
FixNamespaceComments: false
Cpp11BracedListStyle: true
NamespaceIndentation: All
PointerAlignment: Right
SortIncludes: false
SpacesInParentheses: false
SpaceInEmptyParentheses: false
SpaceAfterTemplateKeyword: false
SortUsingDeclarations: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
IndentWidth: 4
TabWidth: 4
ColumnLimit: 0
AccessModifierOffset: -1
UseTab: true
MaxEmptyLinesToKeep: 2
BreakBeforeBraces: Allman
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right 
KeepEmptyLinesAtTheStartOfBlocks: false
AllowShortFunctionsOnASingleLine: None 
BraceWrapping:
  AfterFunction: true
  AfterClass: true
  AfterStruct: true    
  AfterControlStatement: true  
  AfterEnum: true 
  AfterUnion: true
  AfterExternBlock: true
  AfterNamespace: true    
  AfterUnion: true    
  BeforeCatch: true
  BeforeElse: true
  SplitEmptyFunction: true
  SplitEmptyRecord: true
  IndentBraces: false
BreakBeforeBraces: Custom

示例: 此刻c产生:

class Test
{
 public:
   int test();

 private:
   int m_test;
}

但是我希望它删除换行符,使其变为:

class Test
{
 public:
   int test();
 private:
   int m_test;
}

0 个答案:

没有答案