diff options
Diffstat (limited to 'cmd-scroll-mode.c')
-rw-r--r-- | cmd-scroll-mode.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cmd-scroll-mode.c b/cmd-scroll-mode.c index 2d444a9a..a7252e8b 100644 --- a/cmd-scroll-mode.c +++ b/cmd-scroll-mode.c @@ -1,4 +1,4 @@ -/* $Id: cmd-scroll-mode.c,v 1.6 2007-12-06 10:04:42 nicm Exp $ */ +/* $Id: cmd-scroll-mode.c,v 1.7 2008-06-02 18:08:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -30,22 +30,26 @@ void cmd_scroll_mode_exec(void *, struct cmd_ctx *); const struct cmd_entry cmd_scroll_mode_entry = { - "scroll-mode", NULL, "", - CMD_NOCLIENT, - NULL, + "scroll-mode", NULL, + CMD_SESSIONONLY_USAGE, + 0, + cmd_sessiononly_parse, cmd_scroll_mode_exec, - NULL, - NULL, - NULL + cmd_sessiononly_send, + cmd_sessiononly_recv, + cmd_sessiononly_free }; void -cmd_scroll_mode_exec(unused void *ptr, struct cmd_ctx *ctx) +cmd_scroll_mode_exec(void *ptr, struct cmd_ctx *ctx) { - struct window *w = ctx->session->curw->window; + struct session *s; + + if ((s = cmd_sessiononly_get(ptr, ctx)) == NULL) + return; if (ctx->flags & CMD_KEY) - window_set_mode(w, &window_scroll_mode); + window_set_mode(s->curw->window, &window_scroll_mode); if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); |