diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-03 11:03:09 +0000 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-03 11:03:09 +0000 |
commit | ff65c812fcf3e46803bb3fbdc820d0006ea004c3 (patch) | |
tree | 2272aa538b11dfdc9348cb068a43d28b0bf32257 /src | |
parent | 6d8463ea1830acf98467e11a4bb676bd01fd4372 (diff) | |
download | vt100-rust-ff65c812fcf3e46803bb3fbdc820d0006ea004c3.tar.gz vt100-rust-ff65c812fcf3e46803bb3fbdc820d0006ea004c3.zip |
improve formatted output a bit
Diffstat (limited to 'src')
-rw-r--r-- | src/attrs.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/attrs.rs b/src/attrs.rs index 7e27f5a..ef7bf38 100644 --- a/src/attrs.rs +++ b/src/attrs.rs @@ -78,6 +78,10 @@ impl Attrs { pub fn escape_code_diff(&self, other: &Self) -> String { let mut opts = vec![]; + if self != other && self == &Self::default() { + return "\x1b[m".to_string(); + } + if self.fgcolor != other.fgcolor { match self.fgcolor { Color::Default => { @@ -131,7 +135,7 @@ impl Attrs { } if self.bold() != other.bold() { - opts.push(if self.bold() { 1 } else { 21 }); + opts.push(if self.bold() { 1 } else { 22 }); } if self.italic() != other.italic() { opts.push(if self.italic() { 3 } else { 23 }); |