Code

Do not terminate the update when switching back to a loading view
authorJonas Fonseca <fonseca@diku.dk>
Wed, 21 Jan 2009 15:27:15 +0000 (16:27 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 21 Jan 2009 22:09:27 +0000 (23:09 +0100)
Move call to end_update() to begin_update() so checks for view content
is honored in the case where no reloading is necessary.

tig.c

diff --git a/tig.c b/tig.c
index f34334ce7e15682850669743923f75d1c7900fd7..79b23e01ba78784573f2c5d2e564068c0b689089 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2622,6 +2622,9 @@ prepare_update_file(struct view *view, const char *name)
 static bool
 begin_update(struct view *view, bool refresh)
 {
+       if (view->pipe)
+               end_update(view, TRUE);
+
        if (refresh) {
                if (!start_io(&view->io))
                        return FALSE;
@@ -2855,9 +2858,6 @@ open_view(struct view *prev, enum request request, enum open_flags flags)
            (nviews == 1 && base_view != display[0]))
                resize_display();
 
-       if (view->pipe)
-               end_update(view, TRUE);
-
        if (view->ops->open) {
                if (!view->ops->open(view)) {
                        report("Failed to load %s view", view->name);