Update of /cvsroot/tmux/tmux
In directory vz-cvs-2.sog:/tmp/cvs-serv1479

Modified Files:
        cmd-break-pane.c 
Log Message:
Sync OpenBSD patchset 910:

Reset last pane properly when using break-pane as well, fixes a problem
reported to Debian by Hannes von Haugwitz (bug 622677).


Index: cmd-break-pane.c
===================================================================
RCS file: /cvsroot/tmux/tmux/cmd-break-pane.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cmd-break-pane.c    7 Jan 2011 14:45:33 -0000       1.12
+++ cmd-break-pane.c    18 May 2011 20:32:47 -0000      1.13
@@ -57,12 +57,18 @@
                return (-1);
        }
 
-       TAILQ_REMOVE(&wl->window->panes, wp, entry);
-       if (wl->window->active == wp) {
-               wl->window->active = TAILQ_PREV(wp, window_panes, entry);
-               if (wl->window->active == NULL)
-                       wl->window->active = TAILQ_NEXT(wp, entry);
-       }
+       w = wl->window;
+       TAILQ_REMOVE(&w->panes, wp, entry);
+       if (wp == w->active) {
+               w->active = w->last;
+               w->last = NULL;
+               if (w->active == NULL) {
+                       w->active = TAILQ_PREV(wp, window_panes, entry);
+                       if (w->active == NULL)
+                               w->active = TAILQ_NEXT(wp, entry);
+               }
+       } else if (wp == w->last)
+               w->last = NULL;
        layout_close_pane(wp);
 
        w = wp->window = window_create1(s->sx, s->sy);


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to