[gnome-builder] editor: use interactive search mode when copying from clipboard



commit 1a2eaf3eb440b34263431c2c73e657b1a299d863
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 26 20:14:58 2018 -0800

    editor: use interactive search mode when copying from clipboard
    
    This ensures that we update the occurrance count when focusing the search
    entry.
    
    #724

 src/libide/editor/ide-editor-view.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-view.c b/src/libide/editor/ide-editor-view.c
index 054894f31..cff7eb6a9 100644
--- a/src/libide/editor/ide-editor-view.c
+++ b/src/libide/editor/ide-editor-view.c
@@ -682,6 +682,14 @@ ide_editor_view_set_search_text (IdeEditorView *self,
   g_assert (search_text != NULL || from_selection);
   g_assert (IDE_IS_SOURCE_VIEW (view));
 
+  /* Use interactive mode if we're copying from the clipboard, because that
+   * is usually going to be followed by focusing the search box and we want
+   * to make sure the occurrance count is updated.
+   */
+
+  if (from_selection)
+    ide_editor_search_begin_interactive (self->search);
+
   if (from_selection)
     {
       if (gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (self->buffer), &begin, &end))
@@ -690,6 +698,9 @@ ide_editor_view_set_search_text (IdeEditorView *self,
 
   ide_editor_search_set_search_text (self->search, search_text);
   ide_editor_search_set_regex_enabled (self->search, FALSE);
+
+  if (from_selection)
+    ide_editor_search_end_interactive (self->search);
 }
 
 static void


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