From 5c2241e1e30dca1f249e361e8ac1e0750d1e04e5 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Wed, 23 Nov 2011 20:02:23 +0330 Subject: [PATCH] term: allow horizontal movements outside scrolling region Reported and tested by Sara Fauzia . --- term.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/term.c b/term.c index 4a43ee1..08355d6 100644 --- a/term.c +++ b/term.c @@ -546,17 +546,17 @@ static void advance(int dr, int dc, int scrl) { int r = row + dr; int c = col + dc; - if (r >= bot && scrl) { + if (dr && r >= bot && scrl) { int n = bot - r - 1; int nr = (bot - top) + n; scroll_screen(top + -n, nr, n); } - if (r < top && scrl) { + if (dr && r < top && scrl) { int n = top - r; int nr = (bot - top) - n; scroll_screen(top, nr, n); } - r = MIN(bot - 1, MAX(top, r)); + r = dr ? MIN(bot - 1, MAX(top, r)) : r; c = MIN(pad_cols() - 1, MAX(0, c)); move_cursor(r, c); } -- 2.11.4.GIT