diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-02-02 15:32:19 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-02-02 15:32:19 +0000 |
commit | 00c5c72d0ec97708a4e6ad6d07591d0c3e6b6643 (patch) | |
tree | 8a02c1f21da3612b94cec92fb70faa5ac9bfe5eb /clang/lib/Format/ContinuationIndenter.cpp | |
parent | ae7de7117a088f6ca6bd176f995c405b87f8cf1e (diff) | |
download | bcm5719-llvm-00c5c72d0ec97708a4e6ad6d07591d0c3e6b6643.tar.gz bcm5719-llvm-00c5c72d0ec97708a4e6ad6d07591d0c3e6b6643.zip |
[clang-format] Don't reflow across comment pragmas.
Summary:
The comment reflower wasn't taking comment pragmas as reflow stoppers. This patch fixes that.
source:
```
// long long long long
// IWYU pragma:
```
format with column limit = 20 before:
```
// long long long
// long IWYU pragma:
```
format with column limit = 20 after:
```
// long long long
// long
// IWYU pragma:
```
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D29450
llvm-svn: 293898
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 3a100651cab..cd39c54e353 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -1213,7 +1213,7 @@ unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken &Current, BreakableToken::Split SplitBefore(StringRef::npos, 0); if (ReflowInProgress) { SplitBefore = Token->getSplitBefore(LineIndex, RemainingTokenColumns, - RemainingSpace); + RemainingSpace, CommentPragmasRegex); } ReflowInProgress = SplitBefore.first != StringRef::npos; unsigned TailOffset = |