diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-03 15:15:31 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-03 15:15:31 +0100 |
commit | 7474a2c1f783304ff6d9838ba393fae103019eb1 (patch) | |
tree | 297b0bd38a4bb7bc23110ae51b1b5afcbc269222 /src | |
parent | e200c0efde7c6da7cd3357dd4c322a5dd6846518 (diff) | |
download | ratpoison-7474a2c1f783304ff6d9838ba393fae103019eb1.zip |
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".
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |