summaryrefslogtreecommitdiffstats
authortcunha <tcunha>2010-10-24 01:32:35 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-01-02 18:59:31 (GMT)
commit08fe918653bcf88203de5deba89874ed4f5ffe8a (patch) (side-by-side diff)
tree2a85af4bb7ed711d81b3e1bec2c3a8c22f3bfaef
parent780d805bc328f63df18c4c605de00aa41e2df524 (diff)
downloadtmux-old-08fe918653bcf88203de5deba89874ed4f5ffe8a.zip
tmux-old-08fe918653bcf88203de5deba89874ed4f5ffe8a.tar.gz
tmux-old-08fe918653bcf88203de5deba89874ed4f5ffe8a.tar.bz2
Sync OpenBSD patchset 779:
When removing a pane, don't change the active pane unless the active pane is actually the one being removed.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--window.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/window.c b/window.c
index ff1dc27..4c80415 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.138 2010/10/24 00:45:57 tcunha Exp $ */
+/* $Id: window.c,v 1.139 2010/10/24 01:32:35 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -365,9 +365,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);