diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-01-22 17:28:34 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-01-22 17:28:34 +0000 |
commit | 64c26cf8cee2dbd02990d74f586f8595c498194e (patch) | |
tree | bb2028088f7985bdc88f3e2ebffcc46971db87b8 /cmd-new-window.c | |
parent | dcfa183cfe98d62197f40f27b6d22303f97988e8 (diff) |
Sync OpenBSD patchset 611:
Permit !, + and - to be used for window targets to specify last window (!), or
next and previous window by number (+ and -).
Also tidy an if in cmd-new-window.c.
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index a052c273..f90411d9 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-window.c,v 1.42 2009-12-04 22:14:47 tcunha Exp $ */ +/* $Id: cmd-new-window.c,v 1.43 2010-01-22 17:28:34 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -129,21 +129,19 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) wl = NULL; if (idx != -1) wl = winlink_find_by_index(&s->windows, idx); - if (wl != NULL) { - if (data->flag_kill) { - /* - * Can't use session_detach as it will destroy session - * if this makes it empty. - */ - session_alert_cancel(s, wl); - winlink_stack_remove(&s->lastw, wl); - winlink_remove(&s->windows, wl); - - /* Force select/redraw if current. */ - if (wl == s->curw) { - data->flag_detached = 0; - s->curw = NULL; - } + if (wl != NULL && data->flag_kill) { + /* + * Can't use session_detach as it will destroy session if this + * makes it empty. + */ + session_alert_cancel(s, wl); + winlink_stack_remove(&s->lastw, wl); + winlink_remove(&s->windows, wl); + + /* Force select/redraw if current. */ + if (wl == s->curw) { + data->flag_detached = 0; + s->curw = NULL; } } |