diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-09 23:18:20 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-09 23:18:20 +0000 |
commit | b7215c44d0a052d4dd760c854ffab7d76e17bb69 (patch) | |
tree | c11905800757c6b934a593fb79a47f18d1854b44 /usr.bin/tmux/cmd-copy-mode.c | |
parent | 8e3eb13f8784dc91d33df8398915069f8205f27a (diff) |
Merge clock-mode command into copy-mode.
Diffstat (limited to 'usr.bin/tmux/cmd-copy-mode.c')
-rw-r--r-- | usr.bin/tmux/cmd-copy-mode.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c index 1b6cf3bf4b6..12adde12c69 100644 --- a/usr.bin/tmux/cmd-copy-mode.c +++ b/usr.bin/tmux/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-copy-mode.c,v 1.17 2014/10/20 22:29:25 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.18 2015/02/09 23:18:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -21,7 +21,7 @@ #include "tmux.h" /* - * Enter copy mode. + * Enter copy or clock mode. */ enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmd_q *); @@ -34,6 +34,14 @@ const struct cmd_entry cmd_copy_mode_entry = { cmd_copy_mode_exec }; +const struct cmd_entry cmd_clock_mode_entry = { + "clock-mode", NULL, + "t:", 0, 0, + CMD_TARGET_PANE_USAGE, + 0, + cmd_copy_mode_exec +}; + enum cmd_retval cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq) { @@ -43,6 +51,11 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq) if (cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp) == NULL) return (CMD_RETURN_ERROR); + if (self->entry == &cmd_clock_mode_entry) { + window_pane_set_mode(wp, &window_clock_mode); + return (CMD_RETURN_NORMAL); + } + if (wp->mode != &window_copy_mode) { if (window_pane_set_mode(wp, &window_copy_mode) != 0) return (CMD_RETURN_NORMAL); |