diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-04-07 08:45:46 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-04-07 08:45:46 -0400 |
commit | b9e99bac67ca370afba2f67c75df47286462d813 (patch) | |
tree | b22b5333d59c0a869b39644e1a0330ff2c046f7e | |
parent | cbb276aa90589cfc72f75e4414607590d21b6ca6 (diff) | |
download | yelp-b9e99bac67ca370afba2f67c75df47286462d813.tar.gz |
libyelp/yelp-location-entry: Use \W regexp to split search string
I was annoyed that "middle-click" didn't match "middle click".
-rw-r--r-- | libyelp/yelp-location-entry.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c index 55225d78..774af382 100644 --- a/libyelp/yelp-location-entry.c +++ b/libyelp/yelp-location-entry.c @@ -1191,6 +1191,12 @@ entry_match_func (GtkEntryCompletion *completion, gchar **strs; GtkTreeModel *model = gtk_entry_completion_get_model (completion); YelpLocationEntryPrivate *priv = GET_PRIV (entry); + static GRegex *nonword = NULL; + + if (nonword == NULL) + nonword = g_regex_new ("\\W", 0, 0, NULL); + if (nonword == NULL) + return FALSE; gtk_tree_model_get (model, iter, HISTORY_COL_TITLE, &title, @@ -1205,7 +1211,7 @@ entry_match_func (GtkEntryCompletion *completion, g_free (desc); } - strs = g_strsplit (key, " ", -1); + strs = g_regex_split (nonword, key, 0); ret = TRUE; for (stri = 0; strs[stri]; stri++) { if (!titlecase || !strstr (titlecase, strs[stri])) { |