From 2e98c9057de6c5700ca01bd58932373b103ef976 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 17 Apr 2014 09:13:13 +0000 Subject: 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. --- cmd-break-pane.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'cmd-break-pane.c') 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); -- cgit