[gnome-text-editor] searchbar: move to next result after replace



commit 0086635701c3bcfaee6aaf3dcc4cadf6e7d3f668
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 19 14:45:27 2021 -0700

    searchbar: move to next result after replace
    
    Fixes #195

 src/editor-search-bar.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/editor-search-bar.c b/src/editor-search-bar.c
index 1a04894..afdd099 100644
--- a/src/editor-search-bar.c
+++ b/src/editor-search-bar.c
@@ -732,9 +732,13 @@ _editor_search_bar_replace (EditorSearchBar *self)
   gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (buffer), &begin, &end);
 
   if (!gtk_source_search_context_replace (self->context, &begin, &end, replace, -1, &error))
-    g_warning ("Failed to replace match: %s", error->message);
-  else
-    gtk_text_buffer_select_range (GTK_TEXT_BUFFER (buffer), &begin, &begin);
+    {
+      g_warning ("Failed to replace match: %s", error->message);
+      return;
+    }
+
+  gtk_text_buffer_select_range (GTK_TEXT_BUFFER (buffer), &end, &end);
+  _editor_search_bar_move_next (self, FALSE);
 }
 
 void


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