summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-swap-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-08-26 16:35:42 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-08-26 16:35:42 +0000
commit977c8f92242473f11515fe7b3161cd1f75720a75 (patch)
tree612e6f8255d10ad8441050570d44206dcf89f507 /usr.bin/tmux/cmd-swap-window.c
parent4e8f67aa6361c12c373084e78bb81c699cdca9ae (diff)
Fix swap-window -d to work as intended, GitHub issue 1879 from Sam Stuewe.
Diffstat (limited to 'usr.bin/tmux/cmd-swap-window.c')
-rw-r--r--usr.bin/tmux/cmd-swap-window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-swap-window.c b/usr.bin/tmux/cmd-swap-window.c
index e2048155aba..fd33008c49e 100644
--- a/usr.bin/tmux/cmd-swap-window.c
+++ b/usr.bin/tmux/cmd-swap-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-swap-window.c,v 1.24 2019/05/09 08:39:09 nicm Exp $ */
+/* $OpenBSD: cmd-swap-window.c,v 1.25 2019/08/26 16:35:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -77,10 +77,10 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item)
wl_src->window = w_dst;
TAILQ_INSERT_TAIL(&w_dst->winlinks, wl_src, wentry);
- if (!args_has(self->args, 'd')) {
- session_select(src, wl_src->idx);
+ if (args_has(self->args, 'd')) {
+ session_select(dst, wl_dst->idx);
if (src != dst)
- session_select(dst, wl_dst->idx);
+ session_select(src, wl_src->idx);
}
session_group_synchronize_from(src);
server_redraw_session_group(src);