[vte] widget: Narrow the set of word chars



commit 1b6cf784afab99aea861128f5e7bb5619288d6c1
Author: Egmont Koblinger <egmont gmail com>
Date:   Sat Jul 26 23:06:51 2014 +0200

    widget: Narrow the set of word chars
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730632

 src/vte.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index fafeba0..2cd9fad 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5223,9 +5223,15 @@ vte_terminal_key_release(GtkWidget *widget, GdkEventKey *event)
 gboolean
 _vte_is_word_char(gunichar c)
 {
-       return g_unichar_isgraph(c) &&
-               (g_unichar_isalnum(c) ||
-                g_unichar_ispunct(c));
+       if (G_UNLIKELY (!g_unichar_isgraph(c)))
+               return FALSE;
+       if (G_LIKELY (g_unichar_isalnum(c)))
+               return TRUE;
+       if (G_UNLIKELY (g_unichar_type(c) == G_UNICODE_CONNECT_PUNCTUATION))  /* Pc */
+               return TRUE;
+       if (G_UNLIKELY (c == 0x00b7))  /* middle dot, requested in bug 700217 */
+               return TRUE;
+       return FALSE;
 }
 
 /* Check if the characters in the two given locations are in the same class


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]