mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
commit
c5df39daf4
3 changed files with 15 additions and 10 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();
|
||||
|
|
|
@ -6,7 +6,7 @@ Hello,\n\nWorld!
|
|||
c =
|
||||
"""
|
||||
Hello,
|
||||
|
||||
|
||||
World!
|
||||
"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue