[gnome-text-editor] page: fix insertion at position



commit 4347131ca08dacc3400e74b8debae328e68a3df9
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 6 11:00:01 2021 -0700

    page: fix insertion at position

 src/editor-page.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/editor-page.c b/src/editor-page.c
index 3316600..4df8f5f 100644
--- a/src/editor-page.c
+++ b/src/editor-page.c
@@ -384,9 +384,7 @@ goto_line_entry_insert_text_cb (EditorPage *self,
 
   text = gtk_editable_get_text (GTK_EDITABLE (entry));
   str = g_string_new (text);
-
-  if (position < 0)
-    g_string_insert_len (str, *position, new_text, length);
+  g_string_insert_len (str, *position, new_text, length);
 
   for (const char *c = str->str; *c; c = g_utf8_next_char (c))
     {


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