I\'m looking for a clang-format setting to prevent the tool from removing line breaks.
For example, I have my ColumnLimit set to 120, and h
I'm not sure that you clang-format to do exactly what you want, but it is possible to tell clang-format to leave sections of code alone. I use this for exactly the sort of scenario you're talking about, blocks of code where a very particular formatting makes it easier to read.
std::vector get_vec()
{
// clang-format off
return std::vector {
"this is a test",
"some of the lines are longer",
"than other, but I would like",
"to keep them on separate lines"
};
// clang-format on
}
See: http://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code