summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-select-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-select-window.c')
-rw-r--r--usr.bin/tmux/cmd-select-window.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-select-window.c b/usr.bin/tmux/cmd-select-window.c
index f3a29a3c90c..9f06cdedeaa 100644
--- a/usr.bin/tmux/cmd-select-window.c
+++ b/usr.bin/tmux/cmd-select-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-window.c,v 1.7 2011/04/05 19:37:01 nicm Exp $ */
+/* $OpenBSD: cmd-select-window.c,v 1.8 2012/07/11 07:10:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -26,8 +26,8 @@
* Select window by index.
*/
-void cmd_select_window_key_binding(struct cmd *, int);
-int cmd_select_window_exec(struct cmd *, struct cmd_ctx *);
+void cmd_select_window_key_binding(struct cmd *, int);
+enum cmd_retval cmd_select_window_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_select_window_entry = {
"select-window", "selectw",
@@ -83,7 +83,7 @@ cmd_select_window_key_binding(struct cmd *self, int key)
args_set(self->args, 'a', NULL);
}
-int
+enum cmd_retval
cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct args *args = self->args;
@@ -104,23 +104,23 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)
if (next || previous || last) {
s = cmd_find_session(ctx, args_get(args, 't'), 0);
if (s == NULL)
- return (-1);
+ return (CMD_RETURN_ERROR);
activity = args_has(self->args, 'a');
if (next) {
if (session_next(s, activity) != 0) {
ctx->error(ctx, "no next window");
- return (-1);
+ return (CMD_RETURN_ERROR);
}
} else if (previous) {
if (session_previous(s, activity) != 0) {
ctx->error(ctx, "no previous window");
- return (-1);
+ return (CMD_RETURN_ERROR);
}
} else {
if (session_last(s) != 0) {
ctx->error(ctx, "no last window");
- return (-1);
+ return (CMD_RETURN_ERROR);
}
}
@@ -128,12 +128,12 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)
} else {
wl = cmd_find_window(ctx, args_get(args, 't'), &s);
if (wl == NULL)
- return (-1);
+ return (CMD_RETURN_ERROR);
if (session_select(s, wl->idx) == 0)
server_redraw_session(s);
}
recalculate_sizes();
- return (0);
+ return (CMD_RETURN_NORMAL);
}