From 9c4c843baca54ff256bfdbdac231b4b6399b8550 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 3 Dec 2021 14:29:35 -0500 Subject: scrolling down should clear the last row's wrap flag --- src/grid.rs | 2 ++ tests/data/fixtures/il_dl.in | 1 + tests/data/fixtures/il_dl/22.json | 12 ++++++++++++ tests/data/fixtures/il_dl/22.typescript | 1 + 4 files changed, 16 insertions(+) create mode 100644 tests/data/fixtures/il_dl/22.json create mode 100644 tests/data/fixtures/il_dl/22.typescript diff --git a/src/grid.rs b/src/grid.rs index d568205..839ac2f 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -481,6 +481,7 @@ impl Grid { for _ in 0..count { self.rows.remove(self.scroll_bottom as usize); self.rows.insert(self.pos.row as usize, self.new_row()); + self.rows[self.scroll_bottom as usize].wrap(false); } } @@ -514,6 +515,7 @@ impl Grid { for _ in 0..count { self.rows.remove(self.scroll_bottom as usize); self.rows.insert(self.scroll_top as usize, self.new_row()); + self.rows[self.scroll_bottom as usize].wrap(false); } } diff --git a/tests/data/fixtures/il_dl.in b/tests/data/fixtures/il_dl.in index 86d41f8..b2519a6 100644 --- a/tests/data/fixtures/il_dl.in +++ b/tests/data/fixtures/il_dl.in @@ -19,3 +19,4 @@ cd \x1bc\x1b[1;80Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x1b[H \x1b[L \x1bc\x1b[1;80H\x1b[1mab\x1b[M +\x1bc\x1b[23;80Hab\x1b[23H\x1b[L diff --git a/tests/data/fixtures/il_dl/22.json b/tests/data/fixtures/il_dl/22.json new file mode 100644 index 0000000..d4b36d5 --- /dev/null +++ b/tests/data/fixtures/il_dl/22.json @@ -0,0 +1,12 @@ +{ + "contents": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n a", + "cells": { + "23,79": { + "contents": "a" + } + }, + "cursor_position": [ + 22, + 0 + ] +} \ No newline at end of file diff --git a/tests/data/fixtures/il_dl/22.typescript b/tests/data/fixtures/il_dl/22.typescript new file mode 100644 index 0000000..791ffec --- /dev/null +++ b/tests/data/fixtures/il_dl/22.typescript @@ -0,0 +1 @@ +cab \ No newline at end of file -- cgit v1.2.3-54-g00ecf