所以目前我使用下一种风格:
{
BasedOnStyle: "LLVM",
IndentWidth: 4,
UseTab: false,
ColumnLimit: 150,
Standard: "Cpp11",
BreakBeforeBraces: "Attach",
BreakBeforeBinaryOperators: false,
AlwaysBreakTemplateDeclarations: true,
AllowShortLoopsOnASingleLine: false,
AllowShortIfStatementsOnASingleLine: false,
AllowAllParametersOfDeclarationOnNextLine: true,
SpacesInParentheses: true,
SpacesBeforeTrailingComments: 1,
SpaceInEmptyParentheses: false,
SpaceAfterControlStatementKeyword: true,
PointerBindsToType: true,
MaxEmptyLinesToKeep: 1,
IndentFunctionDeclarationAfterType: true,
IndentCaseLabels: true,
ExperimentalAutoDetectBinPacking: true,
DerivePointerBinding: true,
Cpp11BracedListStyle: false,
ConstructorInitializerAllOnOneLineOrOnePerLine: true,
BreakConstructorInitializersBeforeComma: true
}
并得到
try {
}
catch ( ... ) {
}
虽然我想得到
try {
} catch ( ... ) {
}
任何人都可以说哪个Clang-Format 样式选项对这种行为负责吗?