diff options
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 2199781735..8eebda0740 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -723,6 +723,12 @@ private: if (Left.Type == TT_RangeBasedForLoopColon) return 5; + if (Right.is(tok::arrow) || Right.is(tok::period)) { + if (Left.is(tok::r_paren) && Line.Type == LT_BuilderTypeCall) + return 5; // Should be smaller than breaking at a nested comma. + return 150; + } + // In for-loops, prefer breaking at ',' and ';'. if (RootToken.is(tok::kw_for) && (Left.isNot(tok::comma) && Left.isNot(tok::semi))) @@ -753,12 +759,6 @@ private: if (Level != prec::Unknown) return Level; - if (Right.is(tok::arrow) || Right.is(tok::period)) { - if (Left.is(tok::r_paren) && Line.Type == LT_BuilderTypeCall) - return 5; // Should be smaller than breaking at a nested comma. - return 150; - } - return 3; } |