From b05f7a824f98fee35cc1fd31eae62460a743075c Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 12 Jul 2015 14:31:47 +0000 Subject: introduce 'groupsearch' for group menu search; matches on either group number/shortcut and/or name. --- search.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'search.c') diff --git a/search.c b/search.c index 44311fd..7f64460 100644 --- a/search.c +++ b/search.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: search.c,v 1.48 2015/07/01 14:36:42 okan Exp $ + * $OpenBSD: search.c,v 1.49 2015/07/12 14:31:47 okan Exp $ */ #include @@ -137,6 +137,16 @@ search_print_cmd(struct menu *mi, int i) (special) ? "[%s]" : "%s", cmd->name); } +void +search_print_group(struct menu *mi, int i) +{ + struct group_ctx *gc = (struct group_ctx *)mi->ctx; + + (void)snprintf(mi->print, sizeof(mi->print), + (group_holds_only_hidden(gc)) ? "%d: [%s]" : "%d: %s", + gc->num, gc->name); +} + void search_print_client(struct menu *mi, int list) { -- cgit v1.2.3-2-gb3c3