From 6fb8d7e3013e200918425675ebb387830daab34b Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 30 Jan 2009 09:24:24 +0100 Subject: [PATCH] Workaround bug exposed by the redrawwin removal in do_scroll_view The bug means that the message from scrolling up one line when impossible followed by scrolling down one line is not removed by the next action. Workaround this by inserting an extra call to report("") before the call to wrefresh(). --- tig.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tig.c b/tig.c index 146bd70..2a909b6 100644 --- a/tig.c +++ b/tig.c @@ -2274,16 +2274,19 @@ do_scroll_view(struct view *view, int lines) wscrl(view->win, lines); scrollok(view->win, FALSE); - for (; line < end; line++) { - if (!draw_view_line(view, line)) - break; - } + while (line < end && draw_view_line(view, line)) + line++; if (redraw_current_line) draw_view_line(view, view->lineno - view->offset); + /* FIXME: Stupid hack to workaround bug where the message from + * scrolling up one line when impossible followed by scrolling + * down one line is not removed by the next action. */ + if (lines > 0) + report(""); + wrefresh(view->win); } - wrefresh(view->win); report(""); } -- 2.32.0.93.g670b81a890