mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Store state shared between multiple commands in the queue in a shared
structure.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user