diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-10-12 09:45:49 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-10-12 09:45:49 +0100 |
commit | b9dc855016cf79c8bb8469c272dbc6bca24deadc (patch) | |
tree | a2049bea7b17ededbd12b77110d47353ed832e46 /cmd-list-keys.c | |
parent | 27126f87976c63161fcae2ab1eb9c6df726a84ff (diff) | |
parent | 5c49e1d0c1afaf98512b2ffd1f31d91fecff9851 (diff) | |
download | rtmux-b9dc855016cf79c8bb8469c272dbc6bca24deadc.tar.gz rtmux-b9dc855016cf79c8bb8469c272dbc6bca24deadc.tar.bz2 rtmux-b9dc855016cf79c8bb8469c272dbc6bca24deadc.zip |
Merge branch 'obsd-master'
Conflicts:
format.c
osdep-openbsd.c
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r-- | cmd-list-keys.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c index d5f516fa..85cb4744 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -138,8 +138,7 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) const char *tablename, *key, *cmdstr, *mode; const struct mode_key_table *mtab; struct mode_key_binding *mbind; - char repeat[16]; - int width, keywidth, repeatwidth, any_mode; + int width, keywidth, any_mode; tablename = args_get(args, 't'); if ((mtab = mode_key_findtable(tablename)) == NULL) { @@ -147,7 +146,7 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - keywidth = repeatwidth = 0; + keywidth = 0; any_mode = 0; RB_FOREACH(mbind, mode_key_tree, mtab->tree) { key = key_string_lookup_key(mbind->key); @@ -158,13 +157,6 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) width = strlen(key); if (width > keywidth) keywidth = width; - - if (mbind->repeat != 1) { - snprintf(repeat, sizeof repeat, "%u", mbind->repeat); - width = strlen(repeat); - if (width > repeatwidth) - repeatwidth = width; - } } RB_FOREACH(mbind, mode_key_tree, mtab->tree) { @@ -173,20 +165,12 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) mode = ""; if (mbind->mode != 0) mode = "c"; - snprintf(repeat, sizeof repeat, "%u", mbind->repeat); cmdstr = mode_key_tostring(mtab->cmdstr, mbind->cmd); if (cmdstr != NULL) { - cmdq_print(cmdq, - "bind-key -%st %s%s%s%*s %*s %s%s%s%s", + cmdq_print(cmdq, "bind-key -%st %s%s %*s %s", mode, any_mode && *mode == '\0' ? " " : "", mtab->name, - mbind->repeat != 1 ? " -R " : - (repeatwidth == 0 ? "" : " "), - repeatwidth, mbind->repeat != 1 ? repeat : "", - (int)keywidth, key, cmdstr, - mbind->arg != NULL ? " \"" : "", - mbind->arg != NULL ? mbind->arg : "", - mbind->arg != NULL ? "\"": ""); + (int)keywidth, key, cmdstr); } } |