Code

Fix regressions introduced in the last few dirty flag changes
authorJonas Fonseca <fonseca@diku.dk>
Thu, 15 Jan 2009 19:28:04 +0000 (20:28 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 15 Jan 2009 21:35:45 +0000 (22:35 +0100)
Regressions was introduced in ddc5064c42f2adab639feeacf86729a44f06f216.

tig.c

diff --git a/tig.c b/tig.c
index c1412883998d66df15ff7356443e6bdb0bb9d2c4..d5c8a245693eea7c7cdbd62489f0321b866a8c68 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2012,9 +2012,9 @@ redraw_view_dirty(struct view *view)
        int lineno;
 
        for (lineno = 0; lineno < view->height; lineno++) {
-               struct line *line = &view->line[view->offset + lineno];
-
-               if (!line->dirty)
+               if (view->offset + lineno >= view->lines)
+                       break;
+               if (!view->line[view->offset + lineno].dirty)
                        continue;
                dirty = TRUE;
                if (!draw_view_line(view, lineno))
@@ -2682,7 +2682,7 @@ update_view(struct view *view)
        char *line;
        /* Clear the view and redraw everything since the tree sorting
         * might have rearranged things. */
-       bool redraw = FALSE;
+       bool redraw = view->lines == 0;
        bool can_read = TRUE;
 
        if (!view->pipe)
@@ -2735,7 +2735,7 @@ update_view(struct view *view)
                /* Keep the displayed view in sync with line number scaling. */
                if (digits != view->digits) {
                        view->digits = digits;
-                       if (opt_line_number)
+                       if (opt_line_number || view == VIEW(REQ_VIEW_BLAME))
                                redraw = TRUE;
                }
        }