aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-29 05:21:54 -0500
committerJesse Luehrs <doy@tozt.net>2019-12-05 12:54:34 -0500
commita0cbd79c92f9a4703f254291d7fbffaa2c84ffb0 (patch)
treef135beab16e7abcd85a9cc04d23bf33ae564aab5 /src
parent3fbc74f513a5a691dd99705598c3023f3b8bc173 (diff)
downloadvt100-rust-a0cbd79c92f9a4703f254291d7fbffaa2c84ffb0.tar.gz
vt100-rust-a0cbd79c92f9a4703f254291d7fbffaa2c84ffb0.zip
ensure cells with contents always have width
it gets ambiguous where the zero-width characters should go otherwise
Diffstat (limited to 'src')
-rw-r--r--src/cell.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs
index 5da4452..f9f9056 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -44,6 +44,10 @@ impl Cell {
if self.len() >= CODEPOINTS_IN_CELL {
return;
}
+ if self.len() == 0 {
+ self.contents[self.len()] = ' ';
+ self.len += 1;
+ }
self.contents[self.len()] = c;
self.len += 1;