mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
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
139754b9fe
commit
a3efd2ab5a
8
window.c
8
window.c
@ -368,9 +368,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)
|
||||||
{
|
{
|
||||||
w->active = TAILQ_PREV(wp, window_panes, entry);
|
if (wp == w->active) {
|
||||||
if (w->active == NULL)
|
w->active = TAILQ_PREV(wp, window_panes, entry);
|
||||||
w->active = TAILQ_NEXT(wp, entry);
|
if (w->active == NULL)
|
||||||
|
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…
x
Reference in New Issue
Block a user