diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-10-23 12:51:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-10-23 12:51:51 +0000 |
commit | a3efd2ab5aa80757dff1570444faae927ece15b8 (patch) | |
tree | ac103c104d9243b219463e1a88880516476590d4 | |
parent | 139754b9feef91f1911b7a22c3ac2a684eee2aa9 (diff) | |
download | rtmux-a3efd2ab5aa80757dff1570444faae927ece15b8.tar.gz rtmux-a3efd2ab5aa80757dff1570444faae927ece15b8.tar.bz2 rtmux-a3efd2ab5aa80757dff1570444faae927ece15b8.zip |
When removing a pane, don't change the active pane unless the active
pane is actually the one being removed.
-rw-r--r-- | window.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -368,9 +368,11 @@ window_add_pane(struct window *w, u_int hlimit) void window_remove_pane(struct window *w, struct window_pane *wp) { - w->active = TAILQ_PREV(wp, window_panes, entry); - if (w->active == NULL) - w->active = TAILQ_NEXT(wp, entry); + if (wp == w->active) { + w->active = TAILQ_PREV(wp, window_panes, entry); + if (w->active == NULL) + w->active = TAILQ_NEXT(wp, entry); + } TAILQ_REMOVE(&w->panes, wp, entry); window_pane_destroy(wp); |