mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 15:55:33 +00:00
Add sorting (-O flag) and a custom format (-F) to list-keys, from Dane
Jensen in GitHub issue 4845.
This commit is contained in:
@@ -215,6 +215,7 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
|
||||
|
||||
bd = xcalloc(1, sizeof *bd);
|
||||
bd->key = (key & ~KEYC_MASK_FLAGS);
|
||||
bd->tablename = table->name;
|
||||
if (note != NULL)
|
||||
bd->note = xstrdup(note);
|
||||
RB_INSERT(key_bindings, &table->key_bindings, bd);
|
||||
@@ -702,3 +703,15 @@ key_bindings_dispatch(struct key_binding *bd, struct cmdq_item *item,
|
||||
new_item = cmdq_append(c, new_item);
|
||||
return (new_item);
|
||||
}
|
||||
|
||||
int
|
||||
key_bindings_has_repeat(struct key_binding **l, u_int n)
|
||||
{
|
||||
u_int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (l[i]->flags & KEY_BINDING_REPEAT)
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user