From e9e0b5141a06d22a8e53f2a1df98c37adeb21b79 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Fri, 17 Aug 2018 08:40:09 +0900 Subject: [PATCH] [bim] Fix an off-by-one when scrolling the last line on screen --- apps/bim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/bim.c b/apps/bim.c index 390ab421..25e1772b 100644 --- a/apps/bim.c +++ b/apps/bim.c @@ -1740,7 +1740,7 @@ void cursor_down(void) { /* A new line appears on screen at the bottom, draw it */ int l = term_height - env->bottom_size - 1; - if (env->offset + l < env->line_count) { + if (env->offset + l < env->line_count + 1) { redraw_line(l-1, env->offset + l-1); } else { place_cursor(1, 2 + l - 1);