Open
Description
Is it possible to set a maximum length for short lambdas?
In my project, I have a ColumnLimit: 0
and I want to achieve two things:
- Short lambdas should stay on a single line (so I have
AllowShortLambdasOnASingleLine: All
) - Allman-style line breaks before braces for long lambdas (so I have
BreakBeforeBraces: Allman
)
However, it seems that clang-format uses a default maximum line length of 90 characters for short lambdas. When the line length reaches or exceeds 90, clang-format always introduces a line break.
From a code formatting perspective, I want this:
auto SomeLongOneLiner = [](int SomeLongPieceOfCodeHere) { return SomeLongPieceOfCodeHere != 2; }; // 114 characters
To remain on a single line as shown above. But when I run the formatter, it transforms the code into:
auto SomeLongOneLiner = [](int SomeLongPieceOfCodeHere)
{ return SomeLongPieceOfCodeHere != 2; };