clang-format: Don't auto-break short macros in WebKit style.
This fixes llvm.org/PR17842.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194268 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index f289934..a5fc83e 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -391,7 +391,8 @@
if (Indent > Style.ColumnLimit)
return 0;
- unsigned Limit = Style.ColumnLimit - Indent;
+ unsigned Limit =
+ Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent;
// If we already exceed the column limit, we set 'Limit' to 0. The different
// tryMerge..() functions can then decide whether to still do merging.
Limit = TheLine->Last->TotalLength > Limit
@@ -757,6 +758,7 @@
assert(!B.First->Previous);
A.Last->Next = B.First;
B.First->Previous = A.Last;
+ B.First->CanBreakBefore = true;
unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore;
for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) {
Tok->TotalLength += LengthA;