Code

Avoid triggering assertion failure when reloading the status view
authorJonas Fonseca <fonseca@diku.dk>
Tue, 7 Oct 2008 18:43:24 +0000 (20:43 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 7 Oct 2008 18:46:34 +0000 (20:46 +0200)
After staging a diff chunk, the stage view automatically reloads the
status view. If the staging happened while the status view is not
displayed an assertion failure is triggered by draw_view_line(). Fix it
by only conditionally redrawing the view in open_view().

tig.c

diff --git a/tig.c b/tig.c
index 51cbb2043c1a41d0c0cd7c7fac09badb0d5b953e..e64d72aefeb00afb1118b30a748396a02243e127 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2536,7 +2536,7 @@ open_view(struct view *prev, enum request request, enum open_flags flags)
                 * the screen. */
                werase(view->win);
                report("");
-       } else {
+       } else if (view_is_displayed(view)) {
                redraw_view(view);
                report("");
        }