From: Jonas Fonseca Date: Fri, 30 Jan 2009 08:03:11 +0000 (+0100) Subject: Change scrollok strategy to leave it off unless when calling wscrl X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a69e0d8f0613cae37a9d97ab6994cb89fc853ae;p=tig.git Change scrollok strategy to leave it off unless when calling wscrl Should lead to fewer calls. --- diff --git a/tig.c b/tig.c index f8d3eae..c103062 100644 --- a/tig.c +++ b/tig.c @@ -2012,7 +2012,6 @@ draw_view_line(struct view *view, unsigned int lineno) { struct line *line; bool selected = (view->offset + lineno == view->lineno); - bool draw_ok; assert(view_is_displayed(view)); @@ -2036,11 +2035,7 @@ draw_view_line(struct view *view, unsigned int lineno) view->ops->select(view, line); } - scrollok(view->win, FALSE); - draw_ok = view->ops->draw(view, line, lineno); - scrollok(view->win, TRUE); - - return draw_ok; + return view->ops->draw(view, line, lineno); } static void @@ -2186,7 +2181,7 @@ resize_display(void) if (!view->win) die("Failed to create %s view", view->name); - scrollok(view->win, TRUE); + scrollok(view->win, FALSE); view->title = newwin(1, 0, offset + view->height, 0); if (!view->title) @@ -2272,7 +2267,9 @@ do_scroll_view(struct view *view, int lines) int line = lines > 0 ? view->height - lines : 0; int end = line + ABS(lines); + scrollok(view->win, TRUE); wscrl(view->win, lines); + scrollok(view->win, FALSE); for (; line < end; line++) { if (!draw_view_line(view, line))