mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-01 02:42:17 +00:00
Don't keep comments right after the ->
(at least not when the branch is a multiline expr!)
This commit is contained in:
parent
d3f5117d76
commit
18be76ea43
1 changed files with 2 additions and 2 deletions
|
@ -773,14 +773,14 @@ fn fmt_when<'a, 'buf>(
|
||||||
|
|
||||||
match expr.value {
|
match expr.value {
|
||||||
Expr::SpaceBefore(nested, spaces) => {
|
Expr::SpaceBefore(nested, spaces) => {
|
||||||
fmt_spaces_no_blank_lines(buf, spaces.iter(), indent + (INDENT * 2));
|
|
||||||
|
|
||||||
if is_multiline_expr {
|
if is_multiline_expr {
|
||||||
buf.ensure_ends_with_newline();
|
buf.ensure_ends_with_newline();
|
||||||
} else {
|
} else {
|
||||||
buf.spaces(1);
|
buf.spaces(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent + (INDENT * 2));
|
||||||
|
|
||||||
nested.format_with_options(
|
nested.format_with_options(
|
||||||
buf,
|
buf,
|
||||||
Parens::NotNeeded,
|
Parens::NotNeeded,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue