diff options
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index ae8c75ff6dc..891a7188bba 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1146,8 +1146,13 @@ private: return true; if (NewLine) { - int AdditionalIndent = State.Stack.back().Indent - - Previous.Children[0]->Level * Style.IndentWidth; + int AdditionalIndent = 0; + if (State.Stack.size() < 2 || + !State.Stack[State.Stack.size() - 2].JSFunctionInlined) { + AdditionalIndent = State.Stack.back().Indent - + Previous.Children[0]->Level * Style.IndentWidth; + } + Penalty += format(Previous.Children, DryRun, AdditionalIndent, /*FixBadIndentation=*/true); return true; |