aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-06-25 12:01:17 +0100
committerThomas Adam <thomas@xteddy.org>2020-06-25 12:01:17 +0100
commit04a1a84bb8d3b34400b63ca9193faf405e5728d1 (patch)
tree8117cb8f90e297446d029088bdfcca15f55d51fc
parent2a2ebf315ff2ca2533b22c26d407cc5cf90ba325 (diff)
parentf69bdda950fde2218ed3fc189ceaa587a5374ab9 (diff)
downloadrtmux-04a1a84bb8d3b34400b63ca9193faf405e5728d1.tar.gz
rtmux-04a1a84bb8d3b34400b63ca9193faf405e5728d1.tar.bz2
rtmux-04a1a84bb8d3b34400b63ca9193faf405e5728d1.zip
Merge branch 'obsd-master'
-rw-r--r--cmd-new-window.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c
index 0b24474b..ca3e66c4 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -68,10 +68,8 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
before = args_has(args, 'b');
if (args_has(args, 'a') || before) {
idx = winlink_shuffle_up(s, wl, before);
- if (idx == -1) {
- cmdq_error(item, "couldn't get a window index");
- return (CMD_RETURN_ERROR);
- }
+ if (idx == -1)
+ idx = target->idx;
}
memset(&sc, 0, sizeof sc);
@@ -114,7 +112,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
if ((template = args_get(args, 'F')) == NULL)
template = NEW_WINDOW_TEMPLATE;
cp = format_single(item, template, tc, s, new_wl,
- new_wl->window->active);
+ new_wl->window->active);
cmdq_print(item, "%s", cp);
free(cp);
}