LBrace->Next->Type == TT_DesignatedInitializerPeriod)
return 0;
+ // Calculate the number of code points we have to format this list. As the
+ // first token is already placed, we have to subtract it.
+ unsigned RemainingCodePoints = Style.ColumnLimit - State.Column +
+ State.NextToken->Previous->CodePointCount;
+
// Find the best ColumnFormat, i.e. the best number of columns to use.
- unsigned RemainingCharacters = Style.ColumnLimit - State.Stack.back().Indent;
- const ColumnFormat *Format = getColumnFormat(RemainingCharacters);
+ const ColumnFormat *Format = getColumnFormat(RemainingCodePoints);
if (!Format)
return 0;
" 1, 1, 1, 1,\n"
" /**/ /**/ };",
getLLVMStyleWithColumns(39));
+ verifyFormat("return { { aaaaaaaaaaaaaaaaaaaaa }, { aaaaaaaaaaaaaaaaaaa },\n"
+ " { aaaaaaaaaaaaaaaaaaaaa }, { aaaaaaaaaaaaaaaaa } };",
+ getLLVMStyleWithColumns(60));
}
TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {