summaryrefslogtreecommitdiffstats
path: root/cmd-swap-window.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-22 10:22:39 +0000
committernicm <nicm>2017-04-22 10:22:39 +0000
commitee45a8a149e1a3c8fe7c232a9e32f3a007e21bee (patch)
tree21cc9cafd10d55cd7cd92ec616d08ac59adc4a0a /cmd-swap-window.c
parent2c0f826c360fc5a8f0e125759b596eb28441ba65 (diff)
Get rid of the extra layer of flags and cmd_prepare() and just store the
CMD_FIND_* flags in the cmd_entry and call it for the command. Commands with special requirements call it themselves and update the target for hooks to use.
Diffstat (limited to 'cmd-swap-window.c')
-rw-r--r--cmd-swap-window.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd-swap-window.c b/cmd-swap-window.c
index 38252745..39670e3c 100644
--- a/cmd-swap-window.c
+++ b/cmd-swap-window.c
@@ -35,8 +35,8 @@ const struct cmd_entry cmd_swap_window_entry = {
.args = { "ds:t:", 0, 0 },
.usage = "[-d] " CMD_SRCDST_WINDOW_USAGE,
- .sflag = CMD_WINDOW_MARKED,
- .tflag = CMD_WINDOW,
+ .source = { 's', CMD_FIND_WINDOW, CMD_FIND_DEFAULT_MARKED },
+ .target = { 't', CMD_FIND_WINDOW, 0 },
.flags = 0,
.exec = cmd_swap_window_exec
@@ -50,12 +50,12 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item)
struct winlink *wl_src, *wl_dst;
struct window *w_src, *w_dst;
- wl_src = item->state.sflag.wl;
- src = item->state.sflag.s;
+ wl_src = item->source.wl;
+ src = item->source.s;
sg_src = session_group_contains(src);
- wl_dst = item->state.tflag.wl;
- dst = item->state.tflag.s;
+ wl_dst = item->target.wl;
+ dst = item->target.s;
sg_dst = session_group_contains(dst);
if (src != dst && sg_src != NULL && sg_dst != NULL &&