summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-21 14:01:19 +0000
committernicm <nicm>2017-04-21 14:01:19 +0000
commitbba588752f8085da13edcacd71101055bd617303 (patch)
treeb75e32cccebefb24cda475bed163f613a2994548 /key-bindings.c
parent311dad8c28c8c1a842beb3dbb1757064b9d83b2e (diff)
Store state shared between multiple commands in the queue in a shared
structure.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/key-bindings.c b/key-bindings.c
index 37ff7fe7..ae7afb71 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -84,7 +84,7 @@ key_bindings_unref_table(struct key_table *table)
}
void
-key_bindings_add(const char *name, key_code key, int can_repeat,
+key_bindings_add(const char *name, key_code key, int repeat,
struct cmd_list *cmdlist)
{
struct key_table *table;
@@ -104,7 +104,8 @@ key_bindings_add(const char *name, key_code key, int can_repeat,
bd->key = key;
RB_INSERT(key_bindings, &table->key_bindings, bd);
- bd->can_repeat = can_repeat;
+ if (repeat)
+ bd->flags |= KEY_BINDING_REPEAT;
bd->cmdlist = cmdlist;
}
@@ -415,7 +416,8 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c,
cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL));
else {
item = cmdq_get_command(bd->cmdlist, fs, m, 0);
- item->repeat = bd->can_repeat;
+ if (bd->flags & KEY_BINDING_REPEAT)
+ item->shared->flags |= CMDQ_SHARED_REPEAT;
cmdq_append(c, item);
}
}