From a15f8fc4a66420615d237313c6a01fcf532c52a2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 18 Jan 2009 14:40:48 +0000 Subject: Support command sequences separated by " ; ". Also clean up command printing. --- server.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index c5c482c5..37a3986f 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.107 2009-01-18 12:09:42 nicm Exp $ */ +/* $Id: server.c,v 1.108 2009-01-18 14:40:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -587,7 +587,8 @@ server_handle_client(struct client *c) struct window_pane *wp; struct timeval tv; struct key_binding *bd; - int key, prefix, status, flags, xtimeout; + struct cmd *cmd; + int key, prefix, status, xtimeout, can_repeat; xtimeout = options_get_number(&c->session->options, "repeat-time"); if (xtimeout != 0 && c->flags & CLIENT_REPEAT) { @@ -636,10 +637,16 @@ server_handle_client(struct client *c) } continue; } - flags = bd->cmd->entry->flags; + + /* Check repeat flag. */ + can_repeat = 1; + TAILQ_FOREACH(cmd, bd->cmdlist, qentry) { + if (!(cmd->entry->flags & CMD_CANREPEAT)) + can_repeat = 0; + } /* If already repeating, but this key can't repeat, skip it. */ - if (c->flags & CLIENT_REPEAT && !(flags & CMD_CANREPEAT)) { + if (c->flags & CLIENT_REPEAT && !can_repeat) { c->flags &= ~CLIENT_REPEAT; if (key == prefix) c->flags |= CLIENT_PREFIX; @@ -649,7 +656,7 @@ server_handle_client(struct client *c) } /* If this key can repeat, reset the repeat flags and timer. */ - if (xtimeout != 0 && flags & CMD_CANREPEAT) { + if (xtimeout != 0 && can_repeat) { c->flags |= CLIENT_PREFIX|CLIENT_REPEAT; tv.tv_sec = xtimeout / 1000; -- cgit