From e60084d1e8a62716b80872f10e9828fbbb3cadfc Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Tue, 13 Aug 2013 06:50:04 +0000 Subject: [PATCH] clang-format: Slightly adapt line break penalties. Before: aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) ->aaaaaaaaa()); After: aaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaaa()); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188253 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/TokenAnnotator.cpp | 2 +- unittests/Format/FormatTest.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 56a1dbac76..4feddfd8d4 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -1087,7 +1087,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, if (Left.is(tok::l_paren) && Line.MightBeFunctionDecl) return 100; if (Left.opensScope()) - return Left.ParameterCount > 1 ? prec::Comma : 20; + return Left.ParameterCount > 1 ? prec::Comma : 19; if (Right.is(tok::lessless)) { if (Left.is(tok::string_literal)) { diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index ec37252947..71f9dabc8a 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -3248,6 +3248,8 @@ TEST_F(FormatTest, WrapsAtFunctionCallsIfNecessary) { verifyFormat("aaaaa(aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).aaaaa(aaaaa),\n" " aaaaaaaaaaaaaaaaaaaaa);"); + verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaa(\n" + " aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaaa());"); verifyFormat( "aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n" -- 2.40.0