From 47da8f77f27174740c20c1cef99daac15f0bf9e8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 8 Nov 2019 06:22:05 -0500 Subject: VPA should not be restricted to the scroll region since it is absolute positioning --- CHANGELOG.md | 1 + src/grid.rs | 2 -- tests/scroll.rs | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b428575..e16e88d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ `contents_diff`. * Fixed RI when the cursor is at the top of the screen (fixes scrolling up in `less`, for instance). +* Fixed VPA incorrectly being clamped to the scroll region. ## [0.3.1] - 2019-11-06 diff --git a/src/grid.rs b/src/grid.rs index 3c262fe..0d075ea 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -351,8 +351,6 @@ impl Grid { pub fn row_set(&mut self, i: u16) { self.pos.row = i; - self.row_clamp_top(true); - self.row_clamp_bottom(true); } pub fn col_inc(&mut self, count: u16) { diff --git a/tests/scroll.rs b/tests/scroll.rs index b7f3df9..1aa9377 100644 --- a/tests/scroll.rs +++ b/tests/scroll.rs @@ -29,6 +29,10 @@ fn scroll_regions() { assert_eq!(parser.screen().contents(), "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n\n\n15\n16\n17\n18\n21\n22\n23\n24"); parser.process(b"\x1b[10;50H\x1bM"); assert_eq!(parser.screen().contents(), "1\n2\n3\n4\n5\n6\n7\n8\n9\n\n10\n11\n12\n13\n14\n\n\n15\n16\n17\n21\n22\n23\n24"); + + assert_eq!(parser.screen().cursor_position(), (9, 49)); + parser.process(b"\x1b[23d"); + assert_eq!(parser.screen().cursor_position(), (22, 49)); } #[test] -- cgit v1.2.3-54-g00ecf