From e156958580d91b3244e4806ef1a6aa18e900a823 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 6 Dec 2019 21:36:41 -0500 Subject: also move the wide char check inside the loop for ECH --- src/grid.rs | 2 +- tests/data/fixtures/ich_dch_ech.in | 1 + tests/data/fixtures/ich_dch_ech/12.json | 15 +++++++++++++++ tests/data/fixtures/ich_dch_ech/12.typescript | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/data/fixtures/ich_dch_ech/12.json create mode 100644 tests/data/fixtures/ich_dch_ech/12.typescript 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 -- cgit v1.2.3-54-g00ecf