diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 12:54:50 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 12:54:50 +0000 |
commit | 2e65e1ae92a3c54f32a60664cc71e6ce0efccf00 (patch) | |
tree | 05beb474d576216b32f9a9f833aaf78b9b0105f8 /docs/ClangFormatStyleOptions.rst | |
parent | 8e67276e923bb759eb94f623c2529a6ca266e942 (diff) |
[clang-format] Look at NoLineBreak and NoLineBreakInOperand before breakProtrudingToken
Summary:
This patch makes ContinuationIndenter call breakProtrudingToken only if
NoLineBreak and NoLineBreakInOperand is false.
Previously, clang-format required two runs to converge on the following example with 24 columns:
Note that the second operand shouldn't be splitted according to NoLineBreakInOperand, but the
token breaker doesn't take that into account:
```
func(a, "long long long long", c);
```
After first run:
```
func(a, "long long "
"long long",
c);
```
After second run, where NoLineBreakInOperand is taken into account:
```
func(a,
"long long "
"long long",
c);
```
With the patch, clang-format now obtains in one run:
```
func(a,
"long long long"
"long",
c);
```
which is a better token split overall.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D30575
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ClangFormatStyleOptions.rst')
0 files changed, 0 insertions, 0 deletions