Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2025

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