fix some edge cases around multiline attributes
This commit is contained in:
1 parent
f69b84bf34
commit
b6ea722d94
7 files changed
+77
-205
No files matched your search
@@ -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!(
|
||||
|
||||
Reference in new issue
Block a user