From 7474a2c1f783304ff6d9838ba393fae103019eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Mon, 3 Mar 2014 15:15:31 +0100 Subject: Amend find_group: first match by number, then by name. * this is consistent with cmd_select and read_window. If one has a keybinding for "gselect 0" and then happens to have a group named "0", "gselect 0" should keep the same behavior: lead to group numbered 0. Discussed with |cos| who proposed the recent "search groups for exact name match first". --- src/actions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index c6f70d0..07464cf 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1996,10 +1996,6 @@ find_group (char *str) rp_group *group; int n; - /* Exact matches are special cases. */ - if ((group = groups_find_group_by_name (str, 1))) - return group; - /* Check if the user typed a group number. */ n = string_to_number (str); if (n >= 0) @@ -2009,6 +2005,10 @@ find_group (char *str) return group; } + /* Exact matches are special cases. */ + if ((group = groups_find_group_by_name (str, 1))) + return group; + group = groups_find_group_by_name (str, 0); return group; } -- cgit v1.2.3