================
@@ -1241,19 +1240,23 @@ unsigned
ContinuationIndenter::addTokenOnNewLine(LineState &State,
switch (Style.BreakInheritanceList) {
case FormatStyle::BILS_BeforeColon:
case FormatStyle::BILS_AfterComma:
- CurrentState.IsAligned = CurrentState.IsAligned ||
- Current.is(TT_InheritanceColon) ||
- Previous.is(TT_InheritanceComma);
+ if (Current.is(TT_InheritanceColon)) {
+ CurrentState.AlignedTo =
+ Current.getPreviousOneOf(tok::kw_class, tok::kw_struct);
+ } else if (Previous.is(TT_InheritanceComma)) {
+ CurrentState.AlignedTo =
+ Previous.getPreviousOneOf(tok::kw_class, tok::kw_struct);
+ }
----------------
HazardyKnusperkeks wrote:
You still could merge that and always start on `Previous` (actually
`Previous.Previous` would also work), and add a comment to explain that.
https://github.com/llvm/llvm-project/pull/191217
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits