save game

This commit is contained in:
Gerrit Viljoen 2020-05-17 12:26:38 +02:00
parent 7d75017e72
commit 36113ce9f7

View File

@ -360,12 +360,19 @@ impl SmartString {
} }
buf.push(ch); buf.push(ch);
} else { } else {
if ch != '\u{1b}' && ch != '[' && ch != ';' && ch != 'm' && !('0'..'9').contains(&ch) { if ch == 'm' {
buf.push(ch);
fragments.push((visible, buf)); fragments.push((visible, buf));
visible = !visible; visible = !visible;
buf = String::new(); buf = String::new();
} else if ch != '[' && ch != ';' && !('0'..'9').contains(&ch) {
fragments.push((visible, buf));
visible = !visible;
buf = String::new();
buf.push(ch);
} else {
buf.push(ch);
} }
buf.push(ch);
} }
} }
if !buf.is_empty() { if !buf.is_empty() {