aboutsummaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-29 03:55:02 -0500
committerJesse Luehrs <doy@tozt.net>2019-12-05 12:54:34 -0500
commita9b6d72b24fffa55093201c520075d500712a3ff (patch)
tree5169f448939401b90bfa683121b3e00b05e20499 /src/cell.rs
parent971b744c9c7c2c3dc9f055f69c5630ca11f0a09e (diff)
downloadvt100-rust-a9b6d72b24fffa55093201c520075d500712a3ff.tar.gz
vt100-rust-a9b6d72b24fffa55093201c520075d500712a3ff.zip
track fullwidth continuation cells explicitly
this makes the logic a bit easier to follow
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs
index ecc44b2..5da4452 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -112,6 +112,10 @@ impl Cell {
self.len & 0x80 == 0x80
}
+ pub fn is_wide_continuation(&self) -> bool {
+ self.len & 0x40 == 0x40
+ }
+
fn set_wide(&mut self, wide: bool) {
if wide {
self.len |= 0x80;
@@ -120,6 +124,14 @@ impl Cell {
}
}
+ pub(crate) fn set_wide_continuation(&mut self, wide: bool) {
+ if wide {
+ self.len |= 0x40;
+ } else {
+ self.len &= 0xbf;
+ }
+ }
+
pub(crate) fn attrs(&self) -> &crate::attrs::Attrs {
&self.attrs
}