[clang-format] Do not break before long string literals in protos
authorKrasimir Georgiev <krasimir@google.com>
Thu, 8 Feb 2018 10:47:12 +0000 (10:47 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Thu, 8 Feb 2018 10:47:12 +0000 (10:47 +0000)
commit374e6de8e0378c96fc7d1ea1d58433c81cf34cbe
treec89c4da120faee4c732bfd7f86fef600be9e4364
parent014e4654d496a7c6dfeb28903079bd324c16fc2b
[clang-format] Do not break before long string literals in protos

Summary:
This patch is a follow-up to r323319 (which disables string literal breaking for
text protos) and it disables breaking before long string literals.

For example this:
```
keyyyyy: "long string literal"
```
used to get broken into:
```
keyyyyy:
    "long string literal"
```

While at it, I also enabled it for LK_Proto and fixed a bug in the mustBreak code.

Reviewers: djasper, sammccall

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D42957

llvm-svn: 324591
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTestProto.cpp
clang/unittests/Format/FormatTestTextProto.cpp