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

tighten rhs expression whitespace and indent #39

Merged
merged 1 commit into from
Feb 4, 2024
Merged

Conversation

arnetheduck
Copy link
Owner

When rendering the right-hand expression of a keyword like return or an assignment, sometimes we would add a newline and indent.

This PR avoids such extra indent/newlines by allowing partial expressions such as function calls to continue on the same line like so:

let myvariable = functioncall(
  arg0, arg1, ...
)

This saves significant amounts of space as we avoid the extra indent that previously would apply to the arguments in this case.

When rendering the right-hand expression of a keyword like `return` or
an assignment, sometimes we would add a newline and indent.

This PR avoids such extra indent/newlines by allowing partial
expressions such as function calls to continue on the same line like so:

```nim
let myvariable = functioncall(
  arg0, arg1, ...
)
```

This saves significant amounts of space as we avoid the extra indent
that previously would apply to the arguments in this case.
@arnetheduck arnetheduck merged commit 13a4822 into master Feb 4, 2024
6 checks passed
@arnetheduck arnetheduck deleted the expr-line branch February 4, 2024 20:42
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.

1 participant