Skip to content

Commit f3d159c

Browse files
committedFeb 18, 2016
Merging r257763:
------------------------------------------------------------------------ r257763 | djasper | 2016-01-14 05:36:46 -0800 (Thu, 14 Jan 2016) | 8 lines clang-format: Fix incorrectly enforced linebreak with ColumnLimit 0. Before: aaaa[bbbb] .cccc(); After: aaaa[bbbb].cccc(); ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_38@261225 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 961db8d commit f3d159c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎lib/Format/ContinuationIndenter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
182182
return true;
183183

184184
unsigned NewLineColumn = getNewLineColumn(State);
185-
if (Current.isMemberAccess() &&
185+
if (Current.isMemberAccess() && Style.ColumnLimit != 0 &&
186186
State.Column + getLengthToNextOperator(Current) > Style.ColumnLimit &&
187187
(State.Column > NewLineColumn ||
188188
Current.NestingLevel < State.StartOfLineLevel))

‎unittests/Format/FormatTest.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -6135,6 +6135,9 @@ TEST_F(FormatTest, FormatsArrays) {
61356135
" .aaaaaaaaaaaaaaaaaaaaaa();");
61366136

61376137
verifyNoCrash("a[,Y?)]", getLLVMStyleWithColumns(10));
6138+
6139+
FormatStyle NoColumnLimit = getLLVMStyleWithColumns(0);
6140+
verifyFormat("aaaaa[bbbbbb].cccccc()", NoColumnLimit);
61386141
}
61396142

61406143
TEST_F(FormatTest, LineStartsWithSpecialCharacter) {

0 commit comments

Comments
 (0)