save game

This commit is contained in:
Gerrit Viljoen 2020-05-17 12:40:30 +02:00
parent 020efce014
commit 2d37bcc295

View File

@ -354,7 +354,9 @@ impl SmartString {
while let Some(ch) = iter.next() {
if visible {
if ch == '\u{1b}' && Some(&'[') == iter.peek() {
fragments.push((visible, buf));
if !buf.is_empty() {
fragments.push((visible, buf));
}
visible = !visible;
buf = String::new();
}
@ -362,11 +364,15 @@ impl SmartString {
} else {
if ch == 'm' {
buf.push(ch);
fragments.push((visible, buf));
if !buf.is_empty() {
fragments.push((visible, buf));
}
visible = !visible;
buf = String::new();
} else if ch != '[' && ch != ';' && !('0'..='9').contains(&ch) {
fragments.push((visible, buf));
if !buf.is_empty() {
fragments.push((visible, buf));
}
visible = !visible;
buf = String::new();
buf.push(ch);