mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
formatter: support removing blank lines between all when branches in when expressions
This commit is contained in:
parent
802422e6f4
commit
08777434b6
31 changed files with 1 additions and 372 deletions
|
@ -636,9 +636,6 @@ fn fmt_when<'a, 'buf>(
|
|||
indent: u16,
|
||||
) {
|
||||
let is_multiline_condition = loc_condition.is_multiline();
|
||||
let has_multiline_branches = branches
|
||||
.iter()
|
||||
.any(|branch| is_when_patterns_multiline(branch) || branch.value.is_multiline());
|
||||
buf.indent(indent);
|
||||
buf.push_str(
|
||||
"\
|
||||
|
@ -744,9 +741,6 @@ fn fmt_when<'a, 'buf>(
|
|||
|
||||
if it.peek().is_some() {
|
||||
buf.newline();
|
||||
if has_multiline_branches {
|
||||
buf.newline();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue