Skip to content

fix: break hugged lambda body when closing parenthesis wraps#721

Merged
jtkiesel merged 1 commit intomainfrom
fix/lambda-param-wrap-closing-parens
Apr 5, 2025
Merged

fix: break hugged lambda body when closing parenthesis wraps#721
jtkiesel merged 1 commit intomainfrom
fix/lambda-param-wrap-closing-parens

Conversation

@jtkiesel
Copy link
Contributor

@jtkiesel jtkiesel commented Mar 1, 2025

What changed with this PR:

The bodies of lambdas used as hugged arguments are now broken when the closing parenthesis of the enclosing argument list is wrapped.

Example

Input

class Example {

  void example() {
    aaaaaaaaaa(bbbbbbbbbb -> cccccccccc("123456789012345678901234567890123456"));
    aaaaaaaaaa(bbbbbbbbbb -> "123456789012345678901234567890123456789012345678");
  }
}

Output

class Example {

  void example() {
    aaaaaaaaaa(bbbbbbbbbb ->
      "123456789012345678901234567890123456789012345678"
    );
    aaaaaaaaaa(bbbbbbbbbb ->
      cccccccccc("123456789012345678901234567890123456")
    );
  }
}

Relative issues or prs:

Closes #718

@jtkiesel jtkiesel merged commit 841de42 into main Apr 5, 2025
11 checks passed
@jtkiesel jtkiesel deleted the fix/lambda-param-wrap-closing-parens branch April 5, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inner block is not moved to a new line when line length is printWidth + 1 and line ends with multiple parentheses

1 participant