diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 22:09:49 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 22:09:49 +0000 |
commit | 8731755ab4dc79f95f0a5ed8dfc8ae3bb9536256 (patch) | |
tree | b561c06699cfbdb0d771f5b7eda29587662f13c8 /cmd-scroll-mode.c | |
parent | 95cc21c25180d0f2e7b488983e3078834343d162 (diff) | |
download | rtmux-8731755ab4dc79f95f0a5ed8dfc8ae3bb9536256.tar.gz rtmux-8731755ab4dc79f95f0a5ed8dfc8ae3bb9536256.tar.bz2 rtmux-8731755ab4dc79f95f0a5ed8dfc8ae3bb9536256.zip |
Add a windowonly generic command and use it where appropriate. Also trim includes and unused.
Diffstat (limited to 'cmd-scroll-mode.c')
-rw-r--r-- | cmd-scroll-mode.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/cmd-scroll-mode.c b/cmd-scroll-mode.c index 86432fd8..0688e0a9 100644 --- a/cmd-scroll-mode.c +++ b/cmd-scroll-mode.c @@ -1,4 +1,4 @@ -/* $Id: cmd-scroll-mode.c,v 1.8 2008-06-02 21:36:51 nicm Exp $ */ +/* $Id: cmd-scroll-mode.c,v 1.9 2008-06-02 22:09:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -18,9 +18,6 @@ #include <sys/types.h> -#include <getopt.h> -#include <stdlib.h> - #include "tmux.h" /* @@ -31,24 +28,24 @@ void cmd_scroll_mode_exec(void *, struct cmd_ctx *); const struct cmd_entry cmd_scroll_mode_entry = { "scroll-mode", NULL, - CMD_SESSIONONLY_USAGE, + CMD_WINDOWONLY_USAGE, 0, - cmd_sessiononly_parse, + cmd_windowonly_parse, cmd_scroll_mode_exec, - cmd_sessiononly_send, - cmd_sessiononly_recv, - cmd_sessiononly_free + cmd_windowonly_send, + cmd_windowonly_recv, + cmd_windowonly_free }; void cmd_scroll_mode_exec(void *ptr, struct cmd_ctx *ctx) { - struct session *s; + struct winlink *wl; - if ((s = cmd_sessiononly_get(ptr, ctx)) == NULL) + if ((wl = cmd_windowonly_get(ptr, ctx, NULL)) == NULL) return; - window_set_mode(s->curw->window, &window_scroll_mode); + window_set_mode(wl->window, &window_scroll_mode); if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); |