From 073bcb868df8eea8504526f11bce9f831de06e67 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 19 Nov 2021 12:38:59 -0500 Subject: more line wrapping bugs --- CHANGELOG.md | 1 + src/screen.rs | 2 +- tests/data/fixtures/wrap.in | 1 + tests/data/fixtures/wrap/23.json | 3 +++ tests/data/fixtures/wrap/30.json | 18 ++++++++++++++++++ tests/data/fixtures/wrap/30.typescript | 1 + 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/data/fixtures/wrap/30.json create mode 100644 tests/data/fixtures/wrap/30.typescript diff --git a/CHANGELOG.md b/CHANGELOG.md index dc9a22a..0a0b2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ the line * Fixed `Screen::cursor_state_formatted` to draw the last character in a line with the appropriate drawing attributes if it needs to redraw it +* Maintain wrapped state when overwriting a wide character at the end of a line ## [0.13.0] - 2021-11-17 diff --git a/src/screen.rs b/src/screen.rs index 57d1d1c..0c08881 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -915,7 +915,7 @@ impl Screen { col: drawing_pos.col + 1, }) .unwrap(); - next_cell.clear(attrs); + next_cell.set(' ', attrs); } let cell = self.current_cell_mut(); diff --git a/tests/data/fixtures/wrap.in b/tests/data/fixtures/wrap.in index 1c85cb2..491034d 100644 --- a/tests/data/fixtures/wrap.in +++ b/tests/data/fixtures/wrap.in @@ -27,3 +27,4 @@ a \x1b[H\x1b[@ \x1bc\x1b[1;80Haa\x1b[T\x1b[@ \x1bc\na\x1b[1;79Hデ\n +\x1bc\x1b[1;79Hネa\x1b[1;79Hb diff --git a/tests/data/fixtures/wrap/23.json b/tests/data/fixtures/wrap/23.json index 681554c..ef04d51 100644 --- a/tests/data/fixtures/wrap/23.json +++ b/tests/data/fixtures/wrap/23.json @@ -10,6 +10,9 @@ "1,0": { "contents": "d" }, + "1,1": { + "contents": " " + }, "1,2": { "contents": "a" } diff --git a/tests/data/fixtures/wrap/30.json b/tests/data/fixtures/wrap/30.json new file mode 100644 index 0000000..44351c6 --- /dev/null +++ b/tests/data/fixtures/wrap/30.json @@ -0,0 +1,18 @@ +{ + "contents": " b a", + "cells": { + "0,78": { + "contents": "b" + }, + "0,79": { + "contents": " " + }, + "1,0": { + "contents": "a" + } + }, + "cursor_position": [ + 0, + 79 + ] +} \ No newline at end of file diff --git a/tests/data/fixtures/wrap/30.typescript b/tests/data/fixtures/wrap/30.typescript new file mode 100644 index 0000000..73ac4d4 --- /dev/null +++ b/tests/data/fixtures/wrap/30.typescript @@ -0,0 +1 @@ +cネab \ No newline at end of file -- cgit v1.2.3-54-g00ecf