r199105 - clang-format: Don't indent relative to ./->.
Daniel Jasper
djasper at google.com
Mon Jan 13 05:42:08 PST 2014
Author: djasper
Date: Mon Jan 13 07:42:08 2014
New Revision: 199105
URL: http://llvm.org/viewvc/llvm-project?rev=199105&view=rev
Log:
clang-format: Don't indent relative to ./->.
Before:
SomeThing // break
.SomeFunction( // break
param);
After:
SomeThing // break
.SomeFunction( // break
param);
Seems to be more common in editors and codebases I have looked at.
Modified:
cfe/trunk/lib/Format/ContinuationIndenter.cpp
cfe/trunk/unittests/Format/FormatTest.cpp
Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=199105&r1=199104&r2=199105&view=diff
==============================================================================
--- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)
+++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Mon Jan 13 07:42:08 2014
@@ -467,8 +467,6 @@ unsigned ContinuationIndenter::addTokenO
if (!Current.isTrailingComment())
State.Stack.back().LastSpace = State.Column;
- if (Current.isMemberAccess())
- State.Stack.back().LastSpace += Current.ColumnWidth;
State.StartOfLineLevel = State.ParenLevel;
State.LowestLevelOnLine = State.ParenLevel;
Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=199105&r1=199104&r2=199105&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Mon Jan 13 07:42:08 2014
@@ -3333,15 +3333,15 @@ TEST_F(FormatTest, FormatsBuilderPattern
"void f() {\n"
" someo->Add((new util::filetools::Handler(dir))\n"
" ->OnEvent1(NewPermanentCallback(\n"
- " this, &HandlerHolderClass::EventHandlerCBA))\n"
+ " this, &HandlerHolderClass::EventHandlerCBA))\n"
" ->OnEvent2(NewPermanentCallback(\n"
- " this, &HandlerHolderClass::EventHandlerCBB))\n"
+ " this, &HandlerHolderClass::EventHandlerCBB))\n"
" ->OnEvent3(NewPermanentCallback(\n"
- " this, &HandlerHolderClass::EventHandlerCBC))\n"
+ " this, &HandlerHolderClass::EventHandlerCBC))\n"
" ->OnEvent5(NewPermanentCallback(\n"
- " this, &HandlerHolderClass::EventHandlerCBD))\n"
+ " this, &HandlerHolderClass::EventHandlerCBD))\n"
" ->OnEvent6(NewPermanentCallback(\n"
- " this, &HandlerHolderClass::EventHandlerCBE)));\n"
+ " this, &HandlerHolderClass::EventHandlerCBE)));\n"
"}");
verifyFormat(
@@ -3367,7 +3367,7 @@ TEST_F(FormatTest, FormatsBuilderPattern
" .has<bbbbbbbbbbbbbbbbbbbbb>();");
verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaa()\n"
" .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>();");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>();");
// Prefer not to break after empty parentheses.
verifyFormat("FirstToken->WhitespaceRange.getBegin().getLocWithOffset(\n"
More information about the cfe-commits
mailing list