mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Don't write extra newline if it's already there
This commit is contained in:
parent
1bbe56248c
commit
6a83babaf3
1 changed files with 10 additions and 3 deletions
|
@ -340,8 +340,10 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
Newlines::No
|
||||
};
|
||||
|
||||
buf.newline();
|
||||
buf.indent(indent);
|
||||
if !buf.ends_with_newline() {
|
||||
buf.newline();
|
||||
buf.indent(indent);
|
||||
}
|
||||
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
|
||||
ann.format_with_options(buf, parens, next_newlines, indent)
|
||||
}
|
||||
|
@ -519,7 +521,12 @@ impl<'a> Formattable for Tag<'a> {
|
|||
|
||||
for arg in *args {
|
||||
buf.newline();
|
||||
arg.format_with_options(buf, Parens::InApply, Newlines::No, arg_indent);
|
||||
arg.value.format_with_options(
|
||||
buf,
|
||||
Parens::InApply,
|
||||
Newlines::No,
|
||||
arg_indent,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
for arg in *args {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue