arnetheduck / nph

An opinionated code formatter for Nim
Other
77 stars 12 forks source link

tighten rhs expression whitespace and indent #39

Closed arnetheduck closed 4 months ago

arnetheduck commented 4 months ago

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.