[libdazzle] fuzzy: ignore ' when highlighting
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] fuzzy: ignore ' when highlighting
- Date: Sun, 4 Jun 2017 02:21:37 +0000 (UTC)
commit 07c89b2ae5764b21dfd8f674dcfe2b490f61cae5
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 3 19:21:26 2017 -0700
fuzzy: ignore ' when highlighting
This is a fairly common one, so we can skip it along with &
src/fuzzy/dzl-fuzzy-mutable-index.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/fuzzy/dzl-fuzzy-mutable-index.c b/src/fuzzy/dzl-fuzzy-mutable-index.c
index e3157fd..ac1eaf7 100644
--- a/src/fuzzy/dzl-fuzzy-mutable-index.c
+++ b/src/fuzzy/dzl-fuzzy-mutable-index.c
@@ -590,11 +590,20 @@ dzl_fuzzy_highlight (const gchar *str,
str_ch = g_utf8_get_char (str);
match_ch = g_utf8_get_char (match);
- if (str_ch == '&' && !strncmp (str, "&", 5))
+ if (str_ch == '&')
{
- str += 4;
- g_string_append (ret, "&");
- continue;
+ if (0 == strncmp (str, "&", 5))
+ {
+ str += 4;
+ g_string_append (ret, "&");
+ continue;
+ }
+ else if (0 == strncmp (str, "'", 6))
+ {
+ str += 5;
+ g_string_append (ret, "'");
+ continue;
+ }
}
if ((str_ch == match_ch) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]