mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Merge pull request #2112 from rtfeldman/joshuawarner32/fix-defs-indenting
Fix fmt_spaces indenting in the context of 3 or more newlines
This commit is contained in:
commit
23fda0819f
6 changed files with 41 additions and 6 deletions
|
@ -596,8 +596,7 @@ fn fmt_when<'a>(
|
|||
);
|
||||
for when_pattern in rest {
|
||||
if is_multiline {
|
||||
buf.push_str("\n");
|
||||
add_spaces(buf, indent + INDENT);
|
||||
newline(buf, indent + INDENT);
|
||||
buf.push_str("| ");
|
||||
} else {
|
||||
buf.push_str(" | ");
|
||||
|
@ -610,9 +609,9 @@ fn fmt_when<'a>(
|
|||
guard_expr.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent + INDENT);
|
||||
}
|
||||
|
||||
buf.push_str(" ->\n");
|
||||
buf.push_str(" ->");
|
||||
newline(buf, indent + INDENT * 2);
|
||||
|
||||
add_spaces(buf, indent + (INDENT * 2));
|
||||
match expr.value {
|
||||
Expr::SpaceBefore(nested, spaces) => {
|
||||
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent + (INDENT * 2));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue