mirror of
https://gitlab.com/arnekeller/ascii-table.git
synced 2024-12-04 21:49:08 +00:00
save game
This commit is contained in:
parent
020efce014
commit
2d37bcc295
12
src/lib.rs
12
src/lib.rs
@ -354,7 +354,9 @@ impl SmartString {
|
|||||||
while let Some(ch) = iter.next() {
|
while let Some(ch) = iter.next() {
|
||||||
if visible {
|
if visible {
|
||||||
if ch == '\u{1b}' && Some(&'[') == iter.peek() {
|
if ch == '\u{1b}' && Some(&'[') == iter.peek() {
|
||||||
fragments.push((visible, buf));
|
if !buf.is_empty() {
|
||||||
|
fragments.push((visible, buf));
|
||||||
|
}
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
buf = String::new();
|
buf = String::new();
|
||||||
}
|
}
|
||||||
@ -362,11 +364,15 @@ impl SmartString {
|
|||||||
} else {
|
} else {
|
||||||
if ch == 'm' {
|
if ch == 'm' {
|
||||||
buf.push(ch);
|
buf.push(ch);
|
||||||
fragments.push((visible, buf));
|
if !buf.is_empty() {
|
||||||
|
fragments.push((visible, buf));
|
||||||
|
}
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
buf = String::new();
|
buf = String::new();
|
||||||
} else if ch != '[' && ch != ';' && !('0'..='9').contains(&ch) {
|
} else if ch != '[' && ch != ';' && !('0'..='9').contains(&ch) {
|
||||||
fragments.push((visible, buf));
|
if !buf.is_empty() {
|
||||||
|
fragments.push((visible, buf));
|
||||||
|
}
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
buf = String::new();
|
buf = String::new();
|
||||||
buf.push(ch);
|
buf.push(ch);
|
||||||
|
Loading…
Reference in New Issue
Block a user