diff options
author | Thomas Adam <thomas@xteddy.org> | 2018-08-02 15:02:25 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2018-08-02 15:02:25 +0100 |
commit | eceaa9a49345d0ab1cdd2f0489acbbbf4838126a (patch) | |
tree | f60faaec2c6b99b7076ca8e86a1841ea93e18bde /cmd-list-keys.c | |
parent | 2e19a5ecb96d5c4c9abd196b0a61ad88360530d0 (diff) | |
parent | fb1f0fee5af3da964ec359ae2b543353ce47f996 (diff) | |
download | rtmux-eceaa9a49345d0ab1cdd2f0489acbbbf4838126a.tar.gz rtmux-eceaa9a49345d0ab1cdd2f0489acbbbf4838126a.tar.bz2 rtmux-eceaa9a49345d0ab1cdd2f0489acbbbf4838126a.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r-- | cmd-list-keys.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 9e0cac62..5efb0cd2 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -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); |