clang-format: Indent relative to the ./-> and not the function name.

Before:
  aaaaaaaaaaa     //
      .aaaa(      //
           bbbb)  // This is different ..
      .aaaa(      //
          cccc);  // .. from this.

After:
  aaaaaaaaaaa     //
      .aaaa(      //
          bbbb)   // This is identical ..
      .aaaa(      //
          cccc);  // .. to this.

llvm-svn: 234300
This commit is contained in:
Daniel Jasper
2015-04-07 06:41:24 +00:00
parent 2be1bbea7e
commit 9dedc775d7
3 changed files with 4 additions and 4 deletions

View File

@@ -634,7 +634,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
std::min(State.LowestLevelOnLine, Current.NestingLevel);
if (Current.isMemberAccess())
State.Stack.back().StartOfFunctionCall =
Current.LastOperator ? 0 : State.Column + Current.ColumnWidth;
Current.LastOperator ? 0 : State.Column;
if (Current.is(TT_SelectorName))
State.Stack.back().ObjCSelectorNameFound = true;
if (Current.is(TT_CtorInitializerColon)) {

View File

@@ -4085,7 +4085,7 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
" aaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();");
verifyFormat(
"aaaaaaa->aaaaaaa->aaaaaaaaaaaaaaaa(\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" ->aaaaaaaa(aaaaaaaaaaaaaaa);");
verifyFormat(
"aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break\n"
@@ -4094,7 +4094,7 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
"aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa =\n"
" aaaaaa->aaaaaaaaaaaa()\n"
" ->aaaaaaaaaaaaaaaa(\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" ->aaaaaaaaaaaaaaaaa();");
verifyGoogleFormat(
"void f() {\n"

View File

@@ -433,7 +433,7 @@ TEST_F(FormatTestJava, NeverAlignAfterReturn) {
getStyleWithColumns(40));
verifyFormat("return aaaaaaaaaaaaaaaaaaa()\n"
" .bbbbbbbbbbbbbbbbbbb(\n"
" ccccccccccccccc)\n"
" ccccccccccccccc)\n"
" .ccccccccccccccccccc();",
getStyleWithColumns(40));
}