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.
This commit is contained in:
nicm
2014-04-17 09:13:13 +00:00
parent 2740490e27
commit 2e98c9057d
4 changed files with 10 additions and 16 deletions

View File

@ -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);