From 5d8027b75d20174446aa3788f856280aae7dd622 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 30 Jun 2015 18:54:12 +0000 Subject: Introduce a callback for cmd menu printing, special-casing 'lock' and 'term'. --- search.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'search.c') diff --git a/search.c b/search.c index edb3421..9013a9d 100644 --- a/search.c +++ b/search.c @@ -123,6 +123,20 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) } } +void +search_print_cmd(struct menu *mi, int i) +{ + struct cmd *cmd = (struct cmd *)mi->ctx; + int special = 0; + + if ((strcmp(cmd->name, "lock") == 0) || + (strcmp(cmd->name, "term") == 0)) + special = 1; + + (void)snprintf(mi->print, sizeof(mi->print), + (special) ? "[%s]" : "%s", cmd->name); +} + void search_print_client(struct menu *mi, int list) { -- cgit 1.4.1