summaryrefslogtreecommitdiffstats
path: root/cmd-break-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2014-04-17 09:13:13 +0000
committernicm <nicm>2014-04-17 09:13:13 +0000
commit2e98c9057de6c5700ca01bd58932373b103ef976 (patch)
tree49a1f04bf4e1e47c597ef7e1d053a4fc24db0595 /cmd-break-pane.c
parent2740490e279bac7b01f18cc39aa59a5de09e3a95 (diff)
Correct the dance to fix the active pane in join-pane by pulling the
(right) code from break-pane and window_remove_pane into a helper function.
Diffstat (limited to 'cmd-break-pane.c')
-rw-r--r--cmd-break-pane.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/cmd-break-pane.c b/cmd-break-pane.c
index defd22ec..85c5d4d9 100644
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@ -65,16 +65,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
server_unzoom_window(w);
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;
+ window_lost_pane(w, wp);
layout_close_pane(wp);
w = wp->window = window_create1(s->sx, s->sy);