From: Jonas Fonseca Date: Thu, 15 Jan 2009 19:28:04 +0000 (+0100) Subject: Fix regressions introduced in the last few dirty flag changes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;ds=sidebyside;h=85f9b524531fd1ba25568e630fc9dee857d5df47;p=tig.git Fix regressions introduced in the last few dirty flag changes Regressions was introduced in ddc5064c42f2adab639feeacf86729a44f06f216. --- diff --git a/tig.c b/tig.c index c141288..d5c8a24 100644 --- 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; } }