mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 05:19:08 +00:00
Indent for multiline | patterns
This commit is contained in:
parent
872efa9724
commit
244a501433
3 changed files with 21 additions and 17 deletions
|
@ -710,10 +710,15 @@ fn fmt_when<'a, 'buf>(
|
|||
if index != 0 {
|
||||
if is_multiline_patterns {
|
||||
buf.newline();
|
||||
buf.indent(indent + INDENT);
|
||||
// Indent an extra level for the `|`;
|
||||
// otherwise it'll be at the start of the line,
|
||||
// and will be incorrectly parsed as a pattern
|
||||
buf.indent(indent + INDENT + INDENT);
|
||||
buf.push('|');
|
||||
} else {
|
||||
buf.push_str(" |");
|
||||
}
|
||||
|
||||
buf.push_str(" |");
|
||||
buf.spaces(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue