summaryrefslogtreecommitdiffstats
path: root/cmd-list-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 16:02:24 +0000
committernicm <nicm>2020-05-16 16:02:24 +0000
commitd67245c734c9c600ad6d186570a1230aa21b80c8 (patch)
tree9e71286a88716251c09d3dd2c2b323074f9f40ff /cmd-list-keys.c
parent472d77fd0f4af8431267473df3cf109030760fa1 (diff)
Add a customize mode where keys and options may be browsed and changed,
includes adding a brief description of each option. Bound to "C" by default.
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r--cmd-list-keys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c
index 4e7ba39c..60ef73af 100644
--- a/cmd-list-keys.c
+++ b/cmd-list-keys.c
@@ -68,7 +68,8 @@ cmd_list_keys_get_width(const char *tablename, key_code only)
while (bd != NULL) {
if ((only != KEYC_UNKNOWN && bd->key != only) ||
KEYC_IS_MOUSE(bd->key) ||
- bd->note == NULL) {
+ bd->note == NULL ||
+ *bd->note == '\0') {
bd = key_bindings_next(table, bd);
continue;
}
@@ -99,14 +100,15 @@ cmd_list_keys_print_notes(struct cmdq_item *item, struct args *args,
while (bd != NULL) {
if ((only != KEYC_UNKNOWN && bd->key != only) ||
KEYC_IS_MOUSE(bd->key) ||
- (bd->note == NULL && !args_has(args, 'a'))) {
+ ((bd->note == NULL || *bd->note == '\0') &&
+ !args_has(args, 'a'))) {
bd = key_bindings_next(table, bd);
continue;
}
found = 1;
key = key_string_lookup_key(bd->key);
- if (bd->note == NULL)
+ if (bd->note == NULL || *bd->note == '\0')
note = cmd_list_print(bd->cmdlist, 1);
else
note = xstrdup(bd->note);