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

@@ -591,7 +591,7 @@ window_add_pane(struct window *w, u_int hlimit)
}
void
window_remove_pane(struct window *w, struct window_pane *wp)
window_lost_pane(struct window *w, struct window_pane *wp)
{
if (wp == w->active) {
w->active = w->last;
@@ -603,6 +603,12 @@ window_remove_pane(struct window *w, struct window_pane *wp)
}
} else if (wp == w->last)
w->last = NULL;
}
void
window_remove_pane(struct window *w, struct window_pane *wp)
{
window_lost_pane(w, wp);
TAILQ_REMOVE(&w->panes, wp, entry);
window_pane_destroy(wp);