aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-20 02:49:31 -0500
committerJesse Luehrs <doy@tozt.net>2021-11-20 02:49:31 -0500
commit65e6ff12a83f1a8eaf30f807ca688913a16df952 (patch)
tree915eae617acc6c24b82d7d9fb4d5ad16079353dc
parenta04c3bd0498dcc8108807c588a621889277b40e6 (diff)
downloadvt100-rust-65e6ff12a83f1a8eaf30f807ca688913a16df952.tar.gz
vt100-rust-65e6ff12a83f1a8eaf30f807ca688913a16df952.zip
i... don't think this conditional ever did anything?
i can't even understand the logic involved here, but it seems nonsensical to me, and removing it doesn't break any tests
-rw-r--r--src/row.rs48
1 files changed, 2 insertions, 46 deletions
diff --git a/src/row.rs b/src/row.rs
index 7b3c2f0..11763c1 100644
--- a/src/row.rs
+++ b/src/row.rs
@@ -234,28 +234,7 @@ impl Row {
prev_pos.col += if cell.is_wide() { 2 } else { 1 };
let cell_contents = cell.contents();
- if prev_pos.col >= self.cols()
- && !self.wrapped
- && cell.is_wide()
- && cell_contents.chars().count() > 1
- {
- // alternately, we could backspace enough to overwrite
- // the second to last character, then ICH and rewrite
- // the second to last character and then reposition,
- // but that's a lot more complicated and not sure if
- // it's worth it for this much of an edge case
- let mut chars = cell_contents.chars();
- let base = chars.next().unwrap();
- let mut bytes = [0; 4];
- contents.extend(base.encode_utf8(&mut bytes).bytes());
- crate::term::Backspace::default().write_buf(contents);
- for c in chars {
- contents
- .extend(c.encode_utf8(&mut bytes).bytes());
- }
- } else {
- contents.extend(cell_contents.as_bytes());
- }
+ contents.extend(cell_contents.as_bytes());
} else if erase.is_none() {
erase = Some((pos.col, attrs));
}
@@ -405,30 +384,7 @@ impl Row {
}
prev_pos.col += if cell.is_wide() { 2 } else { 1 };
- if prev_pos.col >= self.cols()
- && !self.wrapped
- && cell.is_wide()
- && cell.contents().chars().count() > 1
- {
- // alternately, we could backspace enough to overwrite
- // the second to last character, then ICH and rewrite
- // the second to last character and then reposition,
- // but that's a lot more complicated and not sure if
- // it's worth it for this much of an edge case
- let cell_contents = cell.contents();
- let mut chars = cell_contents.chars();
- let base = chars.next().unwrap();
- let mut bytes = [0; 4];
- contents.extend(base.encode_utf8(&mut bytes).bytes());
- crate::term::Backspace::default().write_buf(contents);
- prev_pos.col -= 1;
- for c in chars {
- contents
- .extend(c.encode_utf8(&mut bytes).bytes());
- }
- } else {
- contents.extend(cell.contents().as_bytes());
- }
+ contents.extend(cell.contents().as_bytes());
} else if erase.is_none() {
erase = Some((pos.col, attrs));
}