Ensure we don't over-indent in type headers (fixes #7358)

This commit is contained in:
Joshua Warner 2024-12-13 14:40:46 -08:00
parent d82accf83d
commit 7cb2d83168
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 115 additions and 1 deletions

View file

@ -549,7 +549,11 @@ impl<'a> Formattable for TypeHeader<'a> {
}
}
buf.ensure_ends_with_whitespace();
if last_multiline {
buf.ensure_ends_with_newline();
} else {
buf.ensure_ends_with_whitespace();
}
last_after = var.after;
last_multiline = var.item.is_multiline();