From b43126f3034dc3e916299cbf2be9fc829f8fe796 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Wed, 7 Mar 2018 16:57:30 +0330 Subject: [PATCH] term: ignore movements beyond the scrolling region --- term.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/term.c b/term.c index 0055e83..eeb62d4 100644 --- a/term.c +++ b/term.c @@ -648,12 +648,14 @@ static void advance(int dr, int dc, int scrl) if (dr && r >= bot && scrl) { int n = bot - r - 1; int nr = (bot - top) + n; - scroll_screen(top + -n, nr, n); + if (nr > 0) + scroll_screen(top + -n, nr, n); } if (dr && r < top && scrl) { int n = top - r; int nr = (bot - top) - n; - scroll_screen(top, nr, n); + if (nr > 0) + scroll_screen(top, nr, n); } r = dr ? LIMIT(r, top, bot - 1) : r; c = LIMIT(c, 0, pad_cols() - 1); -- 2.11.4.GIT