[gnome-text-editor] spellcheck: treat ' as a word char



commit 6266ed2ab020f1b95fe7b9bb97cfe1ed91f47196
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 19 16:45:50 2021 -0700

    spellcheck: treat ' as a word char
    
    It would be really nice if we could rely on this elsewhere, but it's going
    to be extremely common so for now we'll just hard code it. In Flatpak, I'm
    getting 0123456789 for extra_word_chars from enchant, which isn't quite
    enough and doesn't match what we get in Fedora with ' and a number of other
    characters.

 src/editor-spell-cursor.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/editor-spell-cursor.c b/src/editor-spell-cursor.c
index 52731f3..26bbd64 100644
--- a/src/editor-spell-cursor.c
+++ b/src/editor-spell-cursor.c
@@ -159,6 +159,9 @@ is_extra_word_char (const GtkTextIter *iter,
   if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r')
     return FALSE;
 
+  if (ch == '\'')
+    return TRUE;
+
   for (const char *c = extra_word_chars; *c; c = g_utf8_next_char (c))
     {
       if (ch == g_utf8_get_char (c))


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