From 4361847ff7578a8394e25b3127ed680c76a94f78 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 15 Oct 2008 10:14:33 +0200 Subject: [PATCH] update_view: Check the pipes and call end_update() before redrawing This allows the main view to finish its updating of the revision graph so that it is rendered properly for the last commit. As a bonus, it also removes a goto. --- NEWS | 1 + tig.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/NEWS b/NEWS index 5719d46..d192439 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Improvements: Bug fixes: - Separate blame revision and file argument by "--" to avoid problems. + - Main view: fix redrawing of the last commit wrt. the revision graph. tig-0.12.1 ---------- diff --git a/tig.c b/tig.c index f436571..b5078c0 100644 --- a/tig.c +++ b/tig.c @@ -2378,8 +2378,14 @@ update_view(struct view *view) } } - if (!view_is_displayed(view)) - goto check_pipe; + if (ferror(view->pipe) && errno != 0) { + report("Failed to read: %s", strerror(errno)); + end_update(view, TRUE); + + } else if (feof(view->pipe)) { + report(""); + end_update(view, FALSE); + } if (view == VIEW(REQ_VIEW_TREE)) { /* Clear the view and redraw everything since the tree sorting @@ -2409,17 +2415,6 @@ update_view(struct view *view) /* Update the title _after_ the redraw so that if the redraw picks up a * commit reference in view->ref it'll be available here. */ update_view_title(view); - -check_pipe: - if (ferror(view->pipe) && errno != 0) { - report("Failed to read: %s", strerror(errno)); - end_update(view, TRUE); - - } else if (feof(view->pipe)) { - report(""); - end_update(view, FALSE); - } - return TRUE; alloc_error: -- 2.30.2