mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Make struct cmd local to cmd.c and move it out of tmux.h.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user