diff options
author | nicm <nicm> | 2016-10-12 14:50:14 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-10-12 14:50:14 +0000 |
commit | c484c5a2a1b6c8261564b2959866e2cfa061ca99 (patch) | |
tree | 1c5611cb1b3890183d0e6e0efc3342687b6fb7f2 /cmd-list-keys.c | |
parent | 4160df4ca4035c8caafce7650d0fcbcccc391f80 (diff) | |
download | rtmux-c484c5a2a1b6c8261564b2959866e2cfa061ca99.tar.gz rtmux-c484c5a2a1b6c8261564b2959866e2cfa061ca99.tar.bz2 rtmux-c484c5a2a1b6c8261564b2959866e2cfa061ca99.zip |
Drop the edit mode key tables and just use fixed key bindings for the
command prompt.
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r-- | cmd-list-keys.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 85cb4744..e58a90f2 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -135,10 +135,10 @@ static enum cmd_retval cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; - const char *tablename, *key, *cmdstr, *mode; + const char *tablename, *cmdstr; const struct mode_key_table *mtab; struct mode_key_binding *mbind; - int width, keywidth, any_mode; + int width, keywidth; tablename = args_get(args, 't'); if ((mtab = mode_key_findtable(tablename)) == NULL) { @@ -147,30 +147,18 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) } keywidth = 0; - any_mode = 0; RB_FOREACH(mbind, mode_key_tree, mtab->tree) { - key = key_string_lookup_key(mbind->key); - - if (mbind->mode != 0) - any_mode = 1; - - width = strlen(key); + width = strlen(key_string_lookup_key(mbind->key)); if (width > keywidth) keywidth = width; } RB_FOREACH(mbind, mode_key_tree, mtab->tree) { - key = key_string_lookup_key(mbind->key); - - mode = ""; - if (mbind->mode != 0) - mode = "c"; cmdstr = mode_key_tostring(mtab->cmdstr, mbind->cmd); if (cmdstr != NULL) { - cmdq_print(cmdq, "bind-key -%st %s%s %*s %s", - mode, any_mode && *mode == '\0' ? " " : "", - mtab->name, - (int)keywidth, key, cmdstr); + cmdq_print(cmdq, "bind-key -t %s %*s %s", + mtab->name, (int)keywidth, + key_string_lookup_key(mbind->key), cmdstr); } } |