mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Make key trees and some other bits static.
This commit is contained in:
@ -75,10 +75,14 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
|
||||
|
||||
repeat = 0;
|
||||
tablewidth = keywidth = 0;
|
||||
RB_FOREACH(table, key_tables, &key_tables) {
|
||||
if (tablename != NULL && strcmp(table->name, tablename) != 0)
|
||||
table = key_bindings_first_table ();
|
||||
while (table != NULL) {
|
||||
if (tablename != NULL && strcmp(table->name, tablename) != 0) {
|
||||
table = key_bindings_next_table(table);
|
||||
continue;
|
||||
RB_FOREACH(bd, key_bindings, &table->key_bindings) {
|
||||
}
|
||||
bd = key_bindings_first(table);
|
||||
while (bd != NULL) {
|
||||
key = key_string_lookup_key(bd->key);
|
||||
|
||||
if (bd->flags & KEY_BINDING_REPEAT)
|
||||
@ -90,13 +94,20 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
|
||||
width = utf8_cstrwidth(key);
|
||||
if (width > keywidth)
|
||||
keywidth = width;
|
||||
|
||||
bd = key_bindings_next(table, bd);
|
||||
}
|
||||
table = key_bindings_next_table(table);
|
||||
}
|
||||
|
||||
RB_FOREACH(table, key_tables, &key_tables) {
|
||||
if (tablename != NULL && strcmp(table->name, tablename) != 0)
|
||||
table = key_bindings_first_table ();
|
||||
while (table != NULL) {
|
||||
if (tablename != NULL && strcmp(table->name, tablename) != 0) {
|
||||
table = key_bindings_next_table(table);
|
||||
continue;
|
||||
RB_FOREACH(bd, key_bindings, &table->key_bindings) {
|
||||
}
|
||||
bd = key_bindings_first(table);
|
||||
while (bd != NULL) {
|
||||
key = key_string_lookup_key(bd->key);
|
||||
|
||||
if (!repeat)
|
||||
@ -122,7 +133,9 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
|
||||
free(cp);
|
||||
|
||||
cmdq_print(item, "bind-key %s", tmp);
|
||||
bd = key_bindings_next(table, bd);
|
||||
}
|
||||
table = key_bindings_next_table(table);
|
||||
}
|
||||
|
||||
return (CMD_RETURN_NORMAL);
|
||||
|
Reference in New Issue
Block a user