mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Sync OpenBSD patchset 779:
When removing a pane, don't change the active pane unless the active pane is actually the one being removed.
This commit is contained in:
parent
2da0730f78
commit
8703e9f2f9
4
window.c
4
window.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: window.c,v 1.138 2010-10-24 00:45:57 tcunha Exp $ */
|
/* $Id: window.c,v 1.139 2010-10-24 01:32:35 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -365,9 +365,11 @@ window_add_pane(struct window *w, u_int hlimit)
|
|||||||
void
|
void
|
||||||
window_remove_pane(struct window *w, struct window_pane *wp)
|
window_remove_pane(struct window *w, struct window_pane *wp)
|
||||||
{
|
{
|
||||||
|
if (wp == w->active) {
|
||||||
w->active = TAILQ_PREV(wp, window_panes, entry);
|
w->active = TAILQ_PREV(wp, window_panes, entry);
|
||||||
if (w->active == NULL)
|
if (w->active == NULL)
|
||||||
w->active = TAILQ_NEXT(wp, entry);
|
w->active = TAILQ_NEXT(wp, entry);
|
||||||
|
}
|
||||||
|
|
||||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||||
window_pane_destroy(wp);
|
window_pane_destroy(wp);
|
||||||
|
Loading…
Reference in New Issue
Block a user