summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2019-12-08 10:53:42 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2019-12-08 14:02:11 +0000
commit67d49500fd3e55b7315c5cd6ee0638ffaff8c0c7 (patch)
treefc5dcd1d9000593b79ca8e3233fa94c04c8b22a9
parente9d2d7733adba63efc0613d4c037dd20b18c4592 (diff)
downloadfolks-wip/nielsdg/simple-query-fixes.tar.gz
simple-query: Also give a match if the suffix workswip/nielsdg/simple-query-fixes
Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/issues/146
-rw-r--r--folks/simple-query.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/folks/simple-query.vala b/folks/simple-query.vala
index f168f97e..f311c689 100644
--- a/folks/simple-query.vala
+++ b/folks/simple-query.vala
@@ -499,7 +499,9 @@ public class Folks.SimpleQuery : Folks.Query
{
if (str_token == token)
return 3;
- else if (str_token.has_prefix (token))
+ if (str_token.has_prefix (token))
+ return 2;
+ if (str_token.has_suffix (token))
return 2;
}
@@ -507,7 +509,9 @@ public class Folks.SimpleQuery : Folks.Query
{
if (str_token == token)
return 2;
- else if (str_token.has_prefix (token))
+ if (str_token.has_prefix (token))
+ return 1;
+ if (str_token.has_suffix (token))
return 1;
}