fix some edge cases around multiline attributes

This commit is contained in:
Evan Almloff committed 2023-07-19 16:59:20 -07:00
1 parent f69b84bf34
commit b6ea722d94
7 files changed
+77 -205

No files matched your search

+8 -1
View File
@@ -165,7 +165,14 @@ impl Writer<'_> {
match &field.content {
ContentField::ManExpr(exp) => {
let out = prettyplease::unparse_expr(exp);
write!(self.out, "{name}: {out}")?;
let mut lines = out.split('\n').peekable();
let first = lines.next().unwrap();
write!(self.out, "{name}: {first}")?;
for line in lines {
self.out.new_line()?;
self.out.indented_tab()?;
write!(self.out, "{line}")?;
}
}
ContentField::Formatted(s) => {
write!(