From: Jonas Fonseca Date: Fri, 30 Jan 2009 08:24:24 +0000 (+0100) Subject: Workaround bug exposed by the redrawwin removal in do_scroll_view X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6fb8d7e3013e200918425675ebb387830daab34b;p=tig.git 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(). --- 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(""); }