mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
fix for format behavior for multi-line strings
This commit is contained in:
parent
116463893a
commit
83f4cdfaeb
1 changed files with 7 additions and 2 deletions
|
@ -556,8 +556,13 @@ pub fn fmt_str_literal<'buf>(buf: &mut Buf<'buf>, literal: StrLiteral, indent: u
|
||||||
|
|
||||||
for segments in lines.iter() {
|
for segments in lines.iter() {
|
||||||
for seg in segments.iter() {
|
for seg in segments.iter() {
|
||||||
|
// only add indent if the line isn't empty
|
||||||
|
if *seg != StrSegment::Plaintext("\n") {
|
||||||
buf.indent(indent);
|
buf.indent(indent);
|
||||||
format_str_segment(seg, buf, indent);
|
format_str_segment(seg, buf, indent);
|
||||||
|
} else {
|
||||||
|
buf.newline();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.newline();
|
buf.newline();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue