summaryrefslogtreecommitdiffstats
path: root/lib/Format/UnwrappedLineFormatter.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-05-18 08:07:52 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-05-18 08:07:52 +0000
commit618084926fc8867c356bcfe0ff210be7c051eb45 (patch)
tree3c0cbd4b4a59fe8d84937e29079e8680b77c9473 /lib/Format/UnwrappedLineFormatter.cpp
parent422116da285cd4ffe35ffffc5e8fee25ace24f14 (diff)
[clang-format] Make NoLineBreakFormatter respect MustBreakBefore
Summary: This patch makes NoLineBreakFormatter to insert a break before tokens where MustBreakBefore is true. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D33238 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineFormatter.cpp')
-rw-r--r--lib/Format/UnwrappedLineFormatter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineFormatter.cpp b/lib/Format/UnwrappedLineFormatter.cpp
index 8ff893426e..01504da0a2 100644
--- a/lib/Format/UnwrappedLineFormatter.cpp
+++ b/lib/Format/UnwrappedLineFormatter.cpp
@@ -611,7 +611,8 @@ public:
LineState State = Indenter->getInitialState(FirstIndent, &Line, DryRun);
while (State.NextToken) {
formatChildren(State, /*Newline=*/false, DryRun, Penalty);
- Indenter->addTokenToState(State, /*Newline=*/false, DryRun);
+ Indenter->addTokenToState(
+ State, /*Newline=*/State.NextToken->MustBreakBefore, DryRun);
}
return Penalty;
}