version 1.45, 2018/08/02 11:44:07 |
version 1.46, 2019/05/23 14:03:44 |
|
|
struct args *args = self->args; |
struct args *args = self->args; |
struct key_table *table; |
struct key_table *table; |
struct key_binding *bd; |
struct key_binding *bd; |
const char *key, *tablename, *r; |
const char *tablename, *r; |
char *cp, tmp[BUFSIZ]; |
char *key, *cp, tmp[BUFSIZ]; |
int repeat, width, tablewidth, keywidth; |
int repeat, width, tablewidth, keywidth; |
|
|
if (self->entry == &cmd_list_commands_entry) |
if (self->entry == &cmd_list_commands_entry) |
|
|
} |
} |
bd = key_bindings_first(table); |
bd = key_bindings_first(table); |
while (bd != NULL) { |
while (bd != NULL) { |
key = key_string_lookup_key(bd->key); |
key = args_escape(key_string_lookup_key(bd->key)); |
|
|
if (bd->flags & KEY_BINDING_REPEAT) |
if (bd->flags & KEY_BINDING_REPEAT) |
repeat = 1; |
repeat = 1; |
|
|
if (width > keywidth) |
if (width > keywidth) |
keywidth = width; |
keywidth = width; |
|
|
|
free(key); |
bd = key_bindings_next(table, bd); |
bd = key_bindings_next(table, bd); |
} |
} |
table = key_bindings_next_table(table); |
table = key_bindings_next_table(table); |
|
|
} |
} |
bd = key_bindings_first(table); |
bd = key_bindings_first(table); |
while (bd != NULL) { |
while (bd != NULL) { |
key = key_string_lookup_key(bd->key); |
key = args_escape(key_string_lookup_key(bd->key)); |
|
|
if (!repeat) |
if (!repeat) |
r = ""; |
r = ""; |
|
|
strlcat(tmp, " ", sizeof tmp); |
strlcat(tmp, " ", sizeof tmp); |
free(cp); |
free(cp); |
|
|
cp = cmd_list_print(bd->cmdlist); |
cp = cmd_list_print(bd->cmdlist, 1); |
strlcat(tmp, cp, sizeof tmp); |
strlcat(tmp, cp, sizeof tmp); |
free(cp); |
free(cp); |
|
|
cmdq_print(item, "bind-key %s", tmp); |
cmdq_print(item, "bind-key %s", tmp); |
|
|
|
free(key); |
bd = key_bindings_next(table, bd); |
bd = key_bindings_next(table, bd); |
} |
} |
table = key_bindings_next_table(table); |
table = key_bindings_next_table(table); |