mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Tweak ordering.
This commit is contained in:
parent
248f78d29a
commit
f145108258
12
session.c
12
session.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: session.c,v 1.11 2007-09-21 18:31:58 nicm Exp $ */
|
/* $Id: session.c,v 1.12 2007-09-21 18:35:16 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -130,16 +130,16 @@ int
|
|||||||
session_detach(struct session *s, struct window *w)
|
session_detach(struct session *s, struct window *w)
|
||||||
{
|
{
|
||||||
window_remove(&s->windows, w);
|
window_remove(&s->windows, w);
|
||||||
|
if (ARRAY_EMPTY(&s->windows)) {
|
||||||
|
session_destroy(s);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
if (s->last == w)
|
if (s->last == w)
|
||||||
s->last = NULL;
|
s->last = NULL;
|
||||||
if (s->window == w && session_last(s) != 0 && session_previous(s) != 0)
|
if (s->window == w && session_last(s) != 0 && session_previous(s) != 0)
|
||||||
session_next(s);
|
session_next(s);
|
||||||
|
return (0);
|
||||||
if (!ARRAY_EMPTY(&s->windows))
|
|
||||||
return (0);
|
|
||||||
session_destroy(s);
|
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return if session has window. */
|
/* Return if session has window. */
|
||||||
|
Loading…
Reference in New Issue
Block a user