Lines[i] = Lines[i].substr(Offset);
LeadingWhitespace[i] += Offset;
}
- // Exclude empty lines from the calculation of the left-most column.
- if (Lines[i].empty())
- continue;
IndentAtLineBreak = std::min<int>(IndentAtLineBreak, StartOfLineColumn[i]);
}
+ IndentAtLineBreak = std::max<unsigned>(IndentAtLineBreak, Decoration.size());
DEBUG({
for (size_t i = 0; i < Lines.size(); ++i) {
llvm::dbgs() << i << " |" << Lines[i] << "| " << LeadingWhitespace[i]
"/* */someCall(parameter);",
getLLVMStyleWithColumns(15)));
EXPECT_EQ("/*\n**\n*/", format("/*\n**\n*/"));
- // FIXME: Consider whether empty lines can dictated the left-most column.
EXPECT_EQ("/*\n"
"*\n"
" * aaaaaa\n"
- " * aaaaaa\n"
+ "* aaaaaa\n"
"*/",
format("/*\n"
"*\n"
" * aaaaaa aaaaaa\n"
"*/",
getLLVMStyleWithColumns(10)));
+ EXPECT_EQ("/*\n"
+ "**\n"
+ "* aaaaaa\n"
+ "* aaaaaa\n"
+ "*/",
+ format("/*\n"
+ "**\n"
+ "* aaaaaa aaaaaa\n"
+ "*/",
+ getLLVMStyleWithColumns(10)));
FormatStyle NoBinPacking = getLLVMStyle();
NoBinPacking.BinPackParameters = false;