Skip to content
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

Don't double-indent multiline expressions in binary operations #462

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

reese
Copy link
Collaborator

@reese reese commented Feb 7, 2024

Now that binary expressions are modeled as breakables, they (correctly) add an indentation level when they split to multiple lines. However, we usually don't actually start that indentation until after the initial LHS expression, so we need to account for this and dedent the LHS to prevent double-indenting.

Before:

{
  a: Foo
      .calculate_stuff / # Too deep!
    2
}

After:

{
  a: Foo
    .calculate_stuff / # Lookin' good
    2
}

@reese reese requested a review from fables-tales February 7, 2024 15:14
@reese reese merged commit 39c7660 into trunk Feb 7, 2024
7 checks passed
@reese reese deleted the reese-multiline-exprs-in-binary-operations branch February 7, 2024 16:58
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.

3 participants