aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 60fe957a12..00ec79f5e4 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -552,7 +552,9 @@ private:
State.Stack.back().BreakBeforeParameter = true;
}
} else {
- if (Current.is(tok::equal))
+ // FIXME: Put VariablePos into ParenState and remove second part of if().
+ if (Current.is(tok::equal) &&
+ (RootToken.is(tok::kw_for) || State.ParenLevel == 0))
State.VariablePos = State.Column - Previous.FormatTok.TokenLength;
unsigned Spaces = State.NextToken->SpacesRequiredBefore;