diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-22 10:22:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-22 10:22:40 +0000 |
commit | 3b5031a1e691e18e1bbe892b262d81db17887237 (patch) | |
tree | 280122dc6016981c484998db1ba10afbfdadb998 /usr.bin/tmux/cmd-join-pane.c | |
parent | 61be04363b84fafcbfe17c4d58547b1ca814e2c7 (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 'usr.bin/tmux/cmd-join-pane.c')
-rw-r--r-- | usr.bin/tmux/cmd-join-pane.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-join-pane.c b/usr.bin/tmux/cmd-join-pane.c index e1bcc330db4..af8c846cbaa 100644 --- a/usr.bin/tmux/cmd-join-pane.c +++ b/usr.bin/tmux/cmd-join-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-join-pane.c,v 1.31 2017/04/22 08:56:24 nicm Exp $ */ +/* $OpenBSD: cmd-join-pane.c,v 1.32 2017/04/22 10:22:39 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman <tmux@georgester.com> @@ -38,8 +38,8 @@ const struct cmd_entry cmd_join_pane_entry = { .args = { "bdhvp:l:s:t:", 0, 0 }, .usage = "[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE, - .sflag = CMD_PANE_MARKED, - .tflag = CMD_PANE, + .source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED }, + .target = { 't', CMD_FIND_PANE, 0 }, .flags = 0, .exec = cmd_join_pane_exec @@ -52,8 +52,8 @@ const struct cmd_entry cmd_move_pane_entry = { .args = { "bdhvp:l:s:t:", 0, 0 }, .usage = "[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE, - .sflag = CMD_PANE, - .tflag = CMD_PANE, + .source = { 's', CMD_FIND_PANE, 0 }, + .target = { 't', CMD_FIND_PANE, 0 }, .flags = 0, .exec = cmd_join_pane_exec @@ -79,15 +79,15 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item) else not_same_window = 0; - dst_s = item->state.tflag.s; - dst_wl = item->state.tflag.wl; - dst_wp = item->state.tflag.wp; + dst_s = item->target.s; + dst_wl = item->target.wl; + dst_wp = item->target.wp; dst_w = dst_wl->window; dst_idx = dst_wl->idx; server_unzoom_window(dst_w); - src_wl = item->state.sflag.wl; - src_wp = item->state.sflag.wp; + src_wl = item->source.wl; + src_wp = item->source.wp; src_w = src_wl->window; server_unzoom_window(src_w); |