diff options
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs index 2dc1ee4..3d2a9fa 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -14,6 +14,15 @@ impl Cell { self.attrs = a; } + pub(crate) fn append(&mut self, c: char) { + self.contents.push(c); + } + + pub(crate) fn reset(&mut self) { + self.contents = String::new(); + self.attrs = crate::attrs::Attrs::default(); + } + pub fn contents(&self) -> &str { &self.contents } @@ -22,6 +31,10 @@ impl Cell { self.contents != "" } + pub fn is_wide(&self) -> bool { + crate::unicode::str_width(&self.contents) > 1 + } + pub fn fgcolor(&self) -> crate::color::Color { self.attrs.fgcolor } |