[gnome-text-editor] wrap: break graphemes if we cannot break on words



commit 06ebddd930517ae8656c735fffe9b714bd2665e5
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 1 08:42:03 2021 -0700

    wrap: break graphemes if we cannot break on words
    
    Related #104

 src/editor-utils.c              | 2 +-
 src/modelines/modeline-parser.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/editor-utils.c b/src/editor-utils.c
index f80330d..8de743e 100644
--- a/src/editor-utils.c
+++ b/src/editor-utils.c
@@ -293,7 +293,7 @@ _editor_gboolean_to_wrap_mode (GBinding     *binding,
                                gpointer      user_data)
 {
   if (g_value_get_boolean (from_value))
-    g_value_set_enum (to_value, GTK_WRAP_WORD);
+    g_value_set_enum (to_value, GTK_WRAP_WORD_CHAR);
   else
     g_value_set_enum (to_value, GTK_WRAP_NONE);
   return TRUE;
diff --git a/src/modelines/modeline-parser.c b/src/modelines/modeline-parser.c
index 0fcdc51..e0465a6 100644
--- a/src/modelines/modeline-parser.c
+++ b/src/modelines/modeline-parser.c
@@ -285,7 +285,7 @@ parse_vim_modeline (gchar           *s,
                }
                else if (strcmp (key->str, "wrap") == 0)
                {
-                       options->wrap_mode = neg ? GTK_WRAP_NONE : GTK_WRAP_WORD;
+                       options->wrap_mode = neg ? GTK_WRAP_NONE : GTK_WRAP_WORD_CHAR;
 
                        options->set |= MODELINE_SET_WRAP_MODE;
                }
@@ -405,7 +405,7 @@ parse_emacs_modeline (gchar           *s,
                else if (strcmp (key->str, "autowrap") == 0)
                {
                        intval = strcmp (value->str, "nil") != 0;
-                       options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE;
+                       options->wrap_mode = intval ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE;
 
                        options->set |= MODELINE_SET_WRAP_MODE;
                }
@@ -503,7 +503,7 @@ parse_kate_modeline (gchar           *s,
                                 strcmp (value->str, "true") == 0 ||
                                 strcmp (value->str, "1") == 0;
 
-                       options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE;
+                       options->wrap_mode = intval ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE;
 
                        options->set |= MODELINE_SET_WRAP_MODE;
                }


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