diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-29 05:21:54 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-12-05 12:54:34 -0500 |
commit | a0cbd79c92f9a4703f254291d7fbffaa2c84ffb0 (patch) | |
tree | f135beab16e7abcd85a9cc04d23bf33ae564aab5 /src/cell.rs | |
parent | 3fbc74f513a5a691dd99705598c3023f3b8bc173 (diff) | |
download | vt100-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/cell.rs')
-rw-r--r-- | src/cell.rs | 4 |
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; |