Code

Minor usability fix: when closing never switch to an already closed view
authorJonas Fonseca <fonseca@diku.dk>
Sat, 27 May 2006 22:58:04 +0000 (00:58 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Sat, 27 May 2006 22:58:04 +0000 (00:58 +0200)
tig.c

diff --git a/tig.c b/tig.c
index e8ee3ce4cbf53b67f3c595f894cfc4efc2c96d2d..b08d3f74b945a71960871abb82bd2e17b2ff3537 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1495,11 +1495,15 @@ view_driver(struct view *view, enum request request)
                return TRUE;
 
        case REQ_VIEW_CLOSE:
-               if (view->parent) {
+               /* XXX: Mark closed views by letting view->parent point to the
+                * view itself. Parents to closed view should never be
+                * followed. */
+               if (view->parent &&
+                   view->parent->parent != view->parent) {
                        memset(display, 0, sizeof(display));
                        current_view = 0;
                        display[current_view] = view->parent;
-                       view->parent = NULL;
+                       view->parent = view;
                        resize_display();
                        redraw_display();
                        break;