forked from OSchip/llvm-project
clang-format: Fix corner case in "if it saves columns"-calculation.
Before: aaaa .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 256841
This commit is contained in:
parent
5cbae95916
commit
411af72e8c
|
@ -177,7 +177,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
|
|||
return true;
|
||||
|
||||
unsigned NewLineColumn = getNewLineColumn(State);
|
||||
if (State.Column < NewLineColumn)
|
||||
if (State.Column <= NewLineColumn)
|
||||
return false;
|
||||
|
||||
if (Current.isMemberAccess() &&
|
||||
|
|
|
@ -4251,6 +4251,9 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
|
|||
" .aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa)\n"
|
||||
" .aaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);",
|
||||
getLLVMStyleWithColumns(59));
|
||||
verifyFormat("aaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
|
||||
" .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {
|
||||
|
@ -8305,7 +8308,7 @@ TEST_F(FormatTest, ConfigurableUseOfTab) {
|
|||
"\taaaaaaaaaaaaaaaaaaaaaaaaaaaa();\n"
|
||||
"};",
|
||||
Tab);
|
||||
verifyFormat("enum A {\n"
|
||||
verifyFormat("enum AA {\n"
|
||||
"\ta1, // Force multiple lines\n"
|
||||
"\ta2,\n"
|
||||
"\ta3\n"
|
||||
|
|
Loading…
Reference in New Issue