summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-01-29 18:43:40 +0000
committerDaniel Jasper <djasper@google.com>2014-01-29 18:43:40 +0000
commit6e58feef76e2ba57198dcdcb8e4d24f14ace6621 (patch)
treeab63254243acd404327e3c959a3eae25557107b9 /clang/lib/Format/TokenAnnotator.cpp
parent2cbbdf41c061fff572b354ac8549432709f1fe35 (diff)
downloadbcm5719-llvm-6e58feef76e2ba57198dcdcb8e4d24f14ace6621.tar.gz
bcm5719-llvm-6e58feef76e2ba57198dcdcb8e4d24f14ace6621.zip
clang-format: Fix formatting of custom proto options.
Before: repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = { aaaaaaaaaaaaaaaaa : AAAAAAAA }]; After: repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaa : AAAAAAAA}]; llvm-svn: 200405
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 6e82b19148c..a0edae51a72 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1469,7 +1469,7 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
// deliberate choice and might have aligned the contents of the string
// literal accordingly. Thus, we try keep existing line breaks.
return Right.NewlinesBefore > 0;
- } else if (Right.Previous->is(tok::l_brace) &&
+ } else if (Right.Previous->is(tok::l_brace) && Right.NestingLevel == 1 &&
Style.Language == FormatStyle::LK_Proto) {
// Don't enums onto single lines in protocol buffers.
return true;
OpenPOWER on IntegriCloud