diff options
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index af5ac544..95ad5988 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -39,7 +39,7 @@ const struct cmd_entry cmd_new_window_entry = { cmd_new_window_exec }; -int +enum cmd_retval cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; @@ -56,7 +56,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (args_has(args, 'a')) { wl = cmd_find_window(ctx, args_get(args, 't'), &s); if (wl == NULL) - return (-1); + return (CMD_RETURN_ERROR); idx = wl->idx + 1; /* Find the next free index. */ @@ -66,7 +66,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) } if (last == INT_MAX) { ctx->error(ctx, "no free window indexes"); - return (-1); + return (CMD_RETURN_ERROR); } /* Move everything from last - 1 to idx up a bit. */ @@ -77,7 +77,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) } } else { if ((idx = cmd_find_index(ctx, args_get(args, 't'), &s)) == -2) - return (-1); + return (CMD_RETURN_ERROR); } detached = args_has(args, 'd'); @@ -113,7 +113,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl == NULL) { ctx->error(ctx, "create window failed: %s", cause); free(cause); - return (-1); + return (CMD_RETURN_ERROR); } if (!detached) { session_select(s, wl->idx); @@ -139,5 +139,5 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) format_free(ft); } - return (0); + return (CMD_RETURN_NORMAL); } |