From 1c5d9df8d1af0f266923edba8fcb367a51a03d26 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 6 Sep 2013 07:54:20 +0000 Subject: clang-format: Fix comment formatting bugs in nested blocks. This fixes two issues: 1) The indent of a line comment was not adapted to the subsequent statement as it would be outside of a nested block. 2) A missing DryRun flag caused actualy breaks to be inserted in overly long comments while trying to come up with the best line breaking decisions. llvm-svn: 190123 --- clang/lib/Format/ContinuationIndenter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Format/ContinuationIndenter.cpp') diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 9e84ea770fe..d48cb23da94 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -63,7 +63,8 @@ ContinuationIndenter::ContinuationIndenter(const FormatStyle &Style, BinPackInconclusiveFunctions(BinPackInconclusiveFunctions) {} LineState ContinuationIndenter::getInitialState(unsigned FirstIndent, - const AnnotatedLine *Line) { + const AnnotatedLine *Line, + bool DryRun) { LineState State; State.FirstIndent = FirstIndent; State.Column = FirstIndent; @@ -80,8 +81,7 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent, State.IgnoreStackForComparison = false; // The first token has already been indented and thus consumed. - moveStateToNextToken(State, /*DryRun=*/false, - /*Newline=*/false); + moveStateToNextToken(State, DryRun, /*Newline=*/false); return State; } -- cgit v1.2.3