mirror of https://github.com/kdl-org/kdl-rs.git
fix(fmt): Indent trailing brace of nested nodes. (#49)
In 4.3.0, the Display output for nested nodes always puts the trailing
braces on the left margin:
a {
b {
c {
}
}
}
This commit indents the trailing brace to match the node name, at least
when explicit trailing text is not provided.
This commit is contained in:
parent
901fe3fd7b
commit
bbc5e4e6a6
|
|
@ -513,7 +513,7 @@ impl KdlNode {
|
||||||
writeln!(f)?;
|
writeln!(f)?;
|
||||||
}
|
}
|
||||||
children.stringify(f, indent + 4)?;
|
children.stringify(f, indent + 4)?;
|
||||||
write!(f, "}}")?;
|
write!(f, "{:indent$}}}", "", indent = indent)?;
|
||||||
}
|
}
|
||||||
if let Some(trailing) = &self.trailing {
|
if let Some(trailing) = &self.trailing {
|
||||||
write!(f, "{}", trailing)?;
|
write!(f, "{}", trailing)?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue