summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c41915)
raw | patch | inline | side by side (parent: 2c41915)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 14 Jan 2009 16:15:10 +0000 (17:15 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 15 Jan 2009 15:04:09 +0000 (16:04 +0100) |
tig.c | patch | blob | history |
index b0524651934b854e6a18533e8a2cdddda55c356f..68d33acfd75f7484478a366a816b4750267dcd0a 100644 (file)
--- a/tig.c
+++ b/tig.c
view->curline = line;
view->curtype = LINE_NONE;
line->selected = FALSE;
+ line->dirty = 0;
if (selected) {
set_view_attr(view, LINE_CURSOR);
if (!line->dirty)
continue;
- line->dirty = 0;
dirty = TRUE;
if (!draw_view_line(view, lineno))
break;
{
char out_buffer[BUFSIZ * 2];
char *line;
- int redraw_from = -1;
+ /* Clear the view and redraw everything since the tree sorting
+ * might have rearranged things. */
+ bool redraw = view == VIEW(REQ_VIEW_TREE);
bool can_read = TRUE;
if (!view->pipe)
return TRUE;
}
- /* Only redraw if lines are visible. */
- if (view->offset + view->height >= view->lines)
- redraw_from = view->lines - view->offset;
-
for (; (line = io_get(view->pipe, '\n', can_read)); can_read = FALSE) {
size_t linelen = strlen(line);
/* Keep the displayed view in sync with line number scaling. */
if (digits != view->digits) {
view->digits = digits;
- redraw_from = 0;
+ if (opt_line_number)
+ redraw = TRUE;
}
}
if (!view_is_displayed(view))
return TRUE;
- if (view == VIEW(REQ_VIEW_TREE)) {
- /* Clear the view and redraw everything since the tree sorting
- * might have rearranged things. */
+ if (redraw)
redraw_view(view);
-
- } else if (redraw_from >= 0) {
- /* If this is an incremental update, redraw the previous line
- * since for commits some members could have changed when
- * loading the main view. */
- if (redraw_from > 0)
- redraw_from--;
-
- /* Since revision graph visualization requires knowledge
- * about the parent commit, it causes a further one-off
- * needed to be redrawn for incremental updates. */
- if (redraw_from > 0 && opt_rev_graph)
- redraw_from--;
-
- /* Incrementally draw avoids flickering. */
- redraw_view_from(view, redraw_from);
- }
-
- if (view == VIEW(REQ_VIEW_BLAME))
+ else
redraw_view_dirty(view);
/* Update the title _after_ the redraw so that if the redraw picks up a
}
static void
-update_rev_graph(struct rev_graph *graph)
+update_rev_graph(struct view *view, struct rev_graph *graph)
{
/* If this is the finalizing update ... */
if (graph->commit)
if (!graph->prev->commit)
return;
+ if (view->lines > 2)
+ view->line[view->lines - 3].dirty = 1;
+ if (view->lines > 1)
+ view->line[view->lines - 2].dirty = 1;
draw_rev_graph(graph->prev);
done_rev_graph(graph->prev->prev);
}
graph->commit = NULL;
}
}
- update_rev_graph(graph);
+ update_rev_graph(view, graph);
for (i = 0; i < ARRAY_SIZE(graph_stacks); i++)
clear_rev_graph(&graph_stacks[i]);
if (!nameend || !emailend)
break;
- update_rev_graph(graph);
+ update_rev_graph(view, graph);
graph = graph->next;
*nameend = *emailend = 0;
}
string_ncopy(commit->author, ident, strlen(ident));
+ view->line[view->lines - 1].dirty = 1;
/* Parse epoch and timezone */
if (emailend[1] == ' ') {
* shortened titles, etc. */
string_ncopy(commit->title, line, strlen(line));
+ view->line[view->lines - 1].dirty = 1;
}
return TRUE;