summaryrefslogtreecommitdiffstats
path: root/cmd-scroll-mode.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-21 13:11:41 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-21 13:11:41 +0000
commit9a6e47cfa8b7ebac8bebc7c2027fd72bee9d38ab (patch)
tree31a82c492c937f7aae181b906a47d97378c3e813 /cmd-scroll-mode.c
parent9b9ceac657c76ed9fe76f76f3276c1d05593942c (diff)
Initial history support.
Diffstat (limited to 'cmd-scroll-mode.c')
-rw-r--r--cmd-scroll-mode.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/cmd-scroll-mode.c b/cmd-scroll-mode.c
new file mode 100644
index 00000000..3bc98825
--- /dev/null
+++ b/cmd-scroll-mode.c
@@ -0,0 +1,55 @@
+/* $Id: cmd-scroll-mode.c,v 1.1 2007-11-21 13:11:41 nicm Exp $ */
+
+/*
+ * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+
+#include <getopt.h>
+#include <stdlib.h>
+
+#include "tmux.h"
+
+/*
+ * Enter scroll mode. Only valid when bound to a key.
+ */
+
+void cmd_scroll_mode_exec(void *, struct cmd_ctx *);
+
+const struct cmd_entry cmd_scroll_mode_entry = {
+ "scroll-mode", "scroll", "",
+ CMD_NOCLIENT,
+ NULL,
+ cmd_scroll_mode_exec,
+ NULL,
+ NULL,
+ NULL
+};
+
+void
+cmd_scroll_mode_exec(unused void *ptr, struct cmd_ctx *ctx)
+{
+ struct window *w = ctx->session->curw->window;
+
+ if (ctx->flags & CMD_KEY) {
+ w->mode = &window_scroll_mode;
+ w->mode->init(w);
+ server_redraw_window_all(w);
+ }
+
+ if (ctx->cmdclient != NULL)
+ server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
+}