[clang] [clang-format] Stop moving lambda to new line only to indent it more. (PR #141576)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 11:36:23 PDT 2025
================
@@ -325,13 +325,30 @@ bool ContinuationIndenter::canBreak(const LineState &State) {
if (Current.isMemberAccess() && CurrentState.ContainsUnwrappedBuilder)
return false;
- // Don't create a 'hanging' indent if there are multiple blocks in a single
- // statement and we are aligning lambda blocks to their signatures.
- if (Previous.is(tok::l_brace) && State.Stack.size() > 1 &&
+ // Force a lambda onto a new line so that we don't create a 'hanging' indent
+ // if there are multiple blocks in a single statement and we are aligning
+ // lambda blocks to their signatures.
+ if (Previous.is(tok::l_brace) && State.Stack.size() > 2 &&
----------------
HazardyKnusperkeks wrote:
Are you sure it is a good idea to increase the minimum stack size here?
https://github.com/llvm/llvm-project/pull/141576
More information about the cfe-commits
mailing list