aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-12-06 21:36:41 -0500
committerJesse Luehrs <doy@tozt.net>2019-12-06 23:28:04 -0500
commite156958580d91b3244e4806ef1a6aa18e900a823 (patch)
tree214b9680e05940e6487600565bf431691d7a916d
parent2ffb815341c9c97568d4553745eda8e470f5c37a (diff)
downloadvt100-rust-e156958580d91b3244e4806ef1a6aa18e900a823.tar.gz
vt100-rust-e156958580d91b3244e4806ef1a6aa18e900a823.zip
also move the wide char check inside the loop for ECH
-rw-r--r--src/grid.rs2
-rw-r--r--tests/data/fixtures/ich_dch_ech.in1
-rw-r--r--tests/data/fixtures/ich_dch_ech/12.json15
-rw-r--r--tests/data/fixtures/ich_dch_ech/12.typescript1
4 files changed, 18 insertions, 1 deletions
diff --git a/src/grid.rs b/src/grid.rs
index d4a8405..b29668f 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -473,8 +473,8 @@ impl Grid {
let size = self.size;
let pos = self.pos;
let row = self.current_row_mut();
- row.clear_wide(pos.col);
for col in pos.col..((pos.col + count).min(size.cols)) {
+ row.clear_wide(col);
row.erase(col as usize, attrs);
}
}
diff --git a/tests/data/fixtures/ich_dch_ech.in b/tests/data/fixtures/ich_dch_ech.in
index b4f42dd..7d3c6f6 100644
--- a/tests/data/fixtures/ich_dch_ech.in
+++ b/tests/data/fixtures/ich_dch_ech.in
@@ -9,3 +9,4 @@ obar
\x1b[10;11H\x1b[4X
\x1b[10;11H\x1b[400X
\x1b[1;80H \x1b[@
+\x1b[1;80H \x1b[X
diff --git a/tests/data/fixtures/ich_dch_ech/12.json b/tests/data/fixtures/ich_dch_ech/12.json
new file mode 100644
index 0000000..fc1e54f
--- /dev/null
+++ b/tests/data/fixtures/ich_dch_ech/12.json
@@ -0,0 +1,15 @@
+{
+ "contents": " \n\n\n\n\n\n\n\n\n f",
+ "cells": {
+ "0,79": {
+ "contents": " "
+ },
+ "9,9": {
+ "contents": "f"
+ }
+ },
+ "cursor_position": [
+ 0,
+ 80
+ ]
+} \ No newline at end of file
diff --git a/tests/data/fixtures/ich_dch_ech/12.typescript b/tests/data/fixtures/ich_dch_ech/12.typescript
new file mode 100644
index 0000000..55039e7
--- /dev/null
+++ b/tests/data/fixtures/ich_dch_ech/12.typescript
@@ -0,0 +1 @@
+  \ No newline at end of file