When removing a pane, don't change the active pane unless the active

pane is actually the one being removed.
pull/1/head
Nicholas Marriott 2010-10-23 12:51:51 +00:00
parent 139754b9fe
commit a3efd2ab5a
1 changed files with 5 additions and 3 deletions

View File

@ -368,9 +368,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);