mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +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 seg in segments.iter() {
|
||||
buf.indent(indent);
|
||||
format_str_segment(seg, buf, indent);
|
||||
// only add indent if the line isn't empty
|
||||
if *seg != StrSegment::Plaintext("\n") {
|
||||
buf.indent(indent);
|
||||
format_str_segment(seg, buf, indent);
|
||||
} else {
|
||||
buf.newline();
|
||||
}
|
||||
}
|
||||
|
||||
buf.newline();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue