conservative.
In particular, this fixes an unwanted corner case.
Before:
string s =
someFunction("aaaa"
"bbbb");
After:
string s = someFunction(
"aaaa"
"bbbb");
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240129
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Style.AlwaysBreakBeforeMultilineStrings &&
(NewLineColumn == State.FirstIndent + Style.ContinuationIndentWidth ||
- Previous.is(tok::comma)) &&
+ Previous.is(tok::comma) || Current.NestingLevel < 2) &&
!Previous.isOneOf(tok::kw_return, tok::lessless, tok::at) &&
!Previous.isOneOf(TT_InlineASMColon, TT_ConditionalExpr) &&
nextIsMultilineString(State))
verifyFormat("aaaaa(aaaaaa, aaaaaaa(\"aaaa\"\n"
" \"bbbb\"));",
Break);
+ verifyFormat("string s = someFunction(\n"
+ " \"abc\"\n"
+ " \"abc\");",
+ Break);
// As we break before unary operators, breaking right after them is bad.
verifyFormat("string foo = abc ? \"x\"\n"