Code

Eliminate unneeded calls to redrawwin
authorJonas Fonseca <fonseca@diku.dk>
Wed, 28 Jan 2009 22:10:10 +0000 (23:10 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 28 Jan 2009 22:13:48 +0000 (23:13 +0100)
This optimize the view drawing especially when scrolling/moving down the
main view with the diff view open. Should make browsing more bareable
over slow links.

tig.c

diff --git a/tig.c b/tig.c
index b951c64c87a5345c9093efad14956b3f4c27d051..4fac53286e2beeecda9b688d90fda3bac10f3eec 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2061,7 +2061,6 @@ redraw_view_dirty(struct view *view)
 
        if (!dirty)
                return;
-       redrawwin(view->win);
        if (input_mode)
                wnoutrefresh(view->win);
        else
@@ -2078,7 +2077,6 @@ redraw_view_from(struct view *view, int lineno)
                        break;
        }
 
-       redrawwin(view->win);
        if (input_mode)
                wnoutrefresh(view->win);
        else
@@ -2285,7 +2283,6 @@ do_scroll_view(struct view *view, int lines)
                        draw_view_line(view, view->lineno - view->offset);
        }
 
-       redrawwin(view->win);
        wrefresh(view->win);
        report("");
 }
@@ -2419,7 +2416,6 @@ move_view(struct view *view, enum request request)
        /* Draw the current line */
        draw_view_line(view, view->lineno - view->offset);
 
-       redrawwin(view->win);
        wrefresh(view->win);
        report("");
 }
@@ -2447,7 +2443,6 @@ select_view_line(struct view *view, unsigned long lineno)
                if (view_is_displayed(view)) {
                        draw_view_line(view, old_lineno);
                        draw_view_line(view, view->lineno - view->offset);
-                       redrawwin(view->win);
                        wrefresh(view->win);
                } else {
                        view->ops->select(view, &view->line[view->lineno]);