forgot the special case of printing the empty graphics escape sequence

This commit is contained in:
David Bittner
2019-05-10 10:28:01 -04:00
parent 434b4fa913
commit 5162590828
2 changed files with 2 additions and 1 deletions

2
Cargo.lock generated
View File

@@ -2,7 +2,7 @@
# It is not intended for manual editing.
[[package]]
name = "ansi-parser"
version = "0.6.3"
version = "0.6.4"
dependencies = [
"nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

View File

@@ -82,6 +82,7 @@ impl Display for AnsiSequence {
SetGraphicsMode(vec)
=> {
match vec.len() {
0 => write!(formatter, "[m"),
1 => write!(formatter, "[{}m", vec[0]),
2 => write!(formatter, "[{};{}m", vec[0], vec[1]),
3 => write!(formatter, "[{};{};{}m", vec[0], vec[1], vec[2]),