如何停止clang-format break fields分隔符(::)?



clang-format version 15.0.6

比;我可以使用哪些设置来获得如下所示的预期格式?

谢谢

我看到的:

auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();

我的期望:

auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();

我的当前设置的休息:

AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ObjCBreakBeforeNestedBlockParam: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10

我想你没有设置选项ColumnLimit。默认设置为"80"。尝试手动设置,或者如果你不希望它换行,然后将其设置为0

未设置ColumnLimit:

auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();

设置ColumnLimit: 0后:

auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();

相关内容

  • 没有找到相关文章

最新更新