From b7215c44d0a052d4dd760c854ffab7d76e17bb69 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 9 Feb 2015 23:18:20 +0000 Subject: Merge clock-mode command into copy-mode. --- usr.bin/tmux/cmd-copy-mode.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'usr.bin/tmux/cmd-copy-mode.c') 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 @@ -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); -- cgit v1.2.3