summaryrefslogtreecommitdiffstats
path: root/cmd-new-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-01-19 21:27:47 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-01-19 21:27:47 +0000
commit7d75dbbdda237f0d7551d47a903cd04a58b29d42 (patch)
treed07453999e89a6e2f407045c3a6f29619aede8fd /cmd-new-window.c
parentf569950664b79b1a3fff2382f9bec218a476c53b (diff)
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.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c
index d7b59b8b..ea3cff4a 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -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;
}
}