From: Ali Gholami Rudi Date: Wed, 23 Nov 2011 16:32:23 +0000 (+0330) Subject: term: allow horizontal movements outside scrolling region X-Git-Url: https://repo.or.cz/w/fbpad.git/commitdiff_plain/5c2241e1e30dca1f249e361e8ac1e0750d1e04e5 term: allow horizontal movements outside scrolling region Reported and tested by Sara Fauzia . --- 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); }