From 68f5c9c72da0c4430733de2094fbb8bc4d1e0474 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 18 Nov 2009 10:18:25 +0000 Subject: [PATCH] Mark -n keys with (no prefix) rather than []. --- cmd-list-keys.c | 10 ++++++---- tmux.1 | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd-list-keys.c b/cmd-list-keys.c index b61951f9..13785fac 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -71,13 +71,15 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx) key = key_string_lookup_key(bd->key & ~KEYC_PREFIX); if (key == NULL) continue; - if (!(bd->key & KEYC_PREFIX)) - used = xsnprintf(tmp, sizeof tmp, "[%s]: ", key); - else - used = xsnprintf(tmp, sizeof tmp, "%*s: ", width, key); + used = xsnprintf(tmp, sizeof tmp, "%*s: ", width, key); if (used >= sizeof tmp) continue; + if (!(bd->key & KEYC_PREFIX)) { + used = strlcat(tmp, "(no prefix) ", sizeof tmp); + if (used >= sizeof tmp) + continue; + } cmd_list_print(bd->cmdlist, tmp + used, (sizeof tmp) - used); ctx->print(ctx, "%s", tmp); } diff --git a/tmux.1 b/tmux.1 index f62f00b2..412b70b0 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1114,7 +1114,8 @@ are printed. Keys bound without the prefix key (see .Ic bind-key .Fl n ) -are enclosed in square brackets. +are marked with +.Ql (no prefix) . .Pp With .Fl t ,