aboutsummaryrefslogtreecommitdiff
path: root/cmd-list-keys.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-05-13 01:15:31 +0100
committerThomas Adam <thomas@xteddy.org>2020-05-13 01:15:31 +0100
commit9d44df9da95452d985f6e5937dd3c4311bf33548 (patch)
treef25a55a68c42ad5296fed0c4b87ea6a23c3afd75 /cmd-list-keys.c
parent212cf53ea92acdc4fb752efd6ecd9fce99dccaec (diff)
parentba20e46bdc6d4624f54920c0efe753671c5184bb (diff)
downloadrtmux-9d44df9da95452d985f6e5937dd3c4311bf33548.tar.gz
rtmux-9d44df9da95452d985f6e5937dd3c4311bf33548.tar.bz2
rtmux-9d44df9da95452d985f6e5937dd3c4311bf33548.zip
Merge branch 'master' of github.com:tmux/tmux
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);