mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-16 16:41:35 +02:00
Move -s and -c down a level so handling them is the responsibility of the command (with some helper functions), rather than the top-level. This changes the action command syntax so that -s and -c must be after the command rather than before.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-previous-window.c,v 1.6 2007-12-06 09:46:22 nicm Exp $ */
|
||||
/* $Id: cmd-previous-window.c,v 1.7 2008-06-02 18:08:16 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -30,20 +30,26 @@
|
||||
void cmd_previous_window_exec(void *, struct cmd_ctx *);
|
||||
|
||||
const struct cmd_entry cmd_previous_window_entry = {
|
||||
"previous-window", "prev", "",
|
||||
CMD_NOCLIENT,
|
||||
NULL,
|
||||
"previous-window", "prev",
|
||||
CMD_SESSIONONLY_USAGE,
|
||||
0,
|
||||
cmd_sessiononly_parse,
|
||||
cmd_previous_window_exec,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
cmd_sessiononly_send,
|
||||
cmd_sessiononly_recv,
|
||||
cmd_sessiononly_free
|
||||
};
|
||||
|
||||
void
|
||||
cmd_previous_window_exec(unused void *ptr, struct cmd_ctx *ctx)
|
||||
cmd_previous_window_exec(void *ptr, struct cmd_ctx *ctx)
|
||||
{
|
||||
if (session_previous(ctx->session) == 0)
|
||||
server_redraw_session(ctx->session);
|
||||
struct session *s;
|
||||
|
||||
if ((s = cmd_sessiononly_get(ptr, ctx)) == NULL)
|
||||
return;
|
||||
|
||||
if (session_previous(s) == 0)
|
||||
server_redraw_session(s);
|
||||
else
|
||||
ctx->error(ctx, "no previous window");
|
||||
|
||||
|
Reference in New Issue
Block a user