diff options
author | nicm <nicm> | 2020-04-13 08:26:27 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-13 08:26:27 +0000 |
commit | c20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (patch) | |
tree | 970e82f29bd603d459476d44245ce73aad18666e /cmd-select-window.c | |
parent | 9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f (diff) | |
download | rtmux-c20eb0c0ae3347c768894a6355adfd7ebae6f2f3.tar.gz rtmux-c20eb0c0ae3347c768894a6355adfd7ebae6f2f3.tar.bz2 rtmux-c20eb0c0ae3347c768894a6355adfd7ebae6f2f3.zip |
Make struct cmd local to cmd.c and move it out of tmux.h.
Diffstat (limited to 'cmd-select-window.c')
-rw-r--r-- | cmd-select-window.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd-select-window.c b/cmd-select-window.c index 54965e89..3d8d02de 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -84,23 +84,24 @@ const struct cmd_entry cmd_last_window_entry = { static enum cmd_retval cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) { + struct args *args = cmd_get_args(self); struct cmd_find_state *current = &item->shared->current; struct winlink *wl = item->target.wl; struct session *s = item->target.s; int next, previous, last, activity; - next = self->entry == &cmd_next_window_entry; - if (args_has(self->args, 'n')) + next = (cmd_get_entry(self) == &cmd_next_window_entry); + if (args_has(args, 'n')) next = 1; - previous = self->entry == &cmd_previous_window_entry; - if (args_has(self->args, 'p')) + previous = (cmd_get_entry(self) == &cmd_previous_window_entry); + if (args_has(args, 'p')) previous = 1; - last = self->entry == &cmd_last_window_entry; - if (args_has(self->args, 'l')) + last = (cmd_get_entry(self) == &cmd_last_window_entry); + if (args_has(args, 'l')) last = 1; if (next || previous || last) { - activity = args_has(self->args, 'a'); + activity = args_has(args, 'a'); if (next) { if (session_next(s, activity) != 0) { cmdq_error(item, "no next window"); @@ -125,7 +126,7 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) * If -T and select-window is invoked on same window as * current, switch to previous window. */ - if (args_has(self->args, 'T') && wl == s->curw) { + if (args_has(args, 'T') && wl == s->curw) { if (session_last(s) != 0) { cmdq_error(item, "no last window"); return (-1); |