Code

do_scroll_view: drop redraw arg
authorJonas Fonseca <fonseca@diku.dk>
Mon, 11 Sep 2006 21:20:52 +0000 (23:20 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Mon, 11 Sep 2006 21:44:52 +0000 (23:44 +0200)
This redraw thing should be fixed in move_view since this is not relevant
for scroll_view.

tig.c

diff --git a/tig.c b/tig.c
index 7dba19d2f9fe88c4f707ed1702734f425ce6cb55..25c423c5fd70fb5449407e46745625491cb9be78 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1432,12 +1432,10 @@ update_display_cursor(void)
 
 /* Scrolling backend */
 static void
-do_scroll_view(struct view *view, int lines, bool redraw)
+do_scroll_view(struct view *view, int lines)
 {
        bool redraw_current_line = FALSE;
 
-       assert(view_is_displayed(view));
-
        /* The rendering expects the new offset. */
        view->offset += lines;
 
@@ -1474,9 +1472,6 @@ do_scroll_view(struct view *view, int lines, bool redraw)
                        draw_view_line(view, view->lineno - view->offset);
        }
 
-       if (!redraw)
-               return;
-
        redrawwin(view->win);
        wrefresh(view->win);
        report("");
@@ -1488,6 +1483,8 @@ scroll_view(struct view *view, enum request request)
 {
        int lines = 1;
 
+       assert(view_is_displayed(view));
+
        switch (request) {
        case REQ_SCROLL_PAGE_DOWN:
                lines = view->height;
@@ -1519,7 +1516,7 @@ scroll_view(struct view *view, enum request request)
                die("request %d not handled in switch", request);
        }
 
-       do_scroll_view(view, lines, TRUE);
+       do_scroll_view(view, lines);
 }
 
 /* Cursor moving */
@@ -1591,7 +1588,7 @@ move_view(struct view *view, enum request request, bool redraw)
                        }
                }
 
-               do_scroll_view(view, steps, redraw);
+               do_scroll_view(view, steps);
                return;
        }
 
@@ -2014,7 +2011,7 @@ open_view(struct view *prev, enum request request, enum open_flags flags)
 
                /* Scroll the view that was split if the current line is
                 * outside the new limited view. */
-               do_scroll_view(prev, lines, TRUE);
+               do_scroll_view(prev, lines);
        }
 
        if (prev && view != prev) {