mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Fix indent call in when fmt
This commit is contained in:
parent
fa4d3e79ec
commit
ab4c96bc81
5 changed files with 40 additions and 0 deletions
|
@ -1328,6 +1328,7 @@ fn fmt_when<'a>(
|
||||||
guard_expr.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent + INDENT);
|
guard_expr.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent + INDENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf.indent(indent + INDENT);
|
||||||
buf.push_str(" ->");
|
buf.push_str(" ->");
|
||||||
|
|
||||||
match expr.value {
|
match expr.value {
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
when nns is
|
||||||
|
O #
|
||||||
|
-> r
|
|
@ -0,0 +1,32 @@
|
||||||
|
When(
|
||||||
|
@5-8 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "nns",
|
||||||
|
},
|
||||||
|
[
|
||||||
|
WhenBranch {
|
||||||
|
patterns: [
|
||||||
|
@12-13 SpaceBefore(
|
||||||
|
SpaceAfter(
|
||||||
|
Tag(
|
||||||
|
"O",
|
||||||
|
),
|
||||||
|
[
|
||||||
|
LineComment(
|
||||||
|
"",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
value: @18-19 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "r",
|
||||||
|
},
|
||||||
|
guard: None,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
|
@ -0,0 +1,3 @@
|
||||||
|
when nns is
|
||||||
|
O#
|
||||||
|
->r
|
|
@ -653,6 +653,7 @@ mod test_snapshots {
|
||||||
pass/var_minus_two.expr,
|
pass/var_minus_two.expr,
|
||||||
pass/var_then.expr,
|
pass/var_then.expr,
|
||||||
pass/var_when.expr,
|
pass/var_when.expr,
|
||||||
|
pass/when_comment_after_pattern.expr,
|
||||||
pass/when_if_guard.expr,
|
pass/when_if_guard.expr,
|
||||||
pass/when_in_assignment.expr,
|
pass/when_in_assignment.expr,
|
||||||
pass/when_in_binops.expr,
|
pass/when_in_binops.expr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue