From d1b232fe8111cb748383727528aa90bbe740b507 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 2 Dec 2013 19:30:27 +0000 Subject: Prepend the group shortcut in the client search menu; from Thomas Adam. Likewise, prepend shortcut in unhide menu. --- mousefunc.c | 3 ++- search.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mousefunc.c b/mousefunc.c index fbcc764..05cdfe2 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -231,7 +231,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) continue; mi = xcalloc(1, sizeof(*mi)); - (void)strlcpy(mi->text, wname, sizeof(mi->text)); + (void)snprintf(mi->text, sizeof(mi->text), + "(%d) %s", cc->group->shortcut, wname); mi->ctx = cc; TAILQ_INSERT_TAIL(&menuq, mi, entry); } diff --git a/search.c b/search.c index 20e7621..4d5a7c1 100644 --- a/search.c +++ b/search.c @@ -142,8 +142,8 @@ search_print_client(struct menu *mi, int list) if (list) cc->matchname = cc->name; - (void)snprintf(mi->print, sizeof(mi->print), "%c%s", flag, - cc->matchname); + (void)snprintf(mi->print, sizeof(mi->print), "(%d) %c%s", + cc->group->shortcut, flag, cc->matchname); if (!list && cc->matchname != cc->name && strlen(mi->print) < sizeof(mi->print) - 1) { -- cgit 1.4.1