[gnome-builder] editor: scroll to insert after selecting it



commit 77ccf642687b74ec04e749bc24edf13350c49122
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 13 03:23:51 2017 -0700

    editor: scroll to insert after selecting it

 libide/editor/ide-editor-view.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libide/editor/ide-editor-view.c b/libide/editor/ide-editor-view.c
index ad8210d..fe54a79 100644
--- a/libide/editor/ide-editor-view.c
+++ b/libide/editor/ide-editor-view.c
@@ -1053,7 +1053,10 @@ ide_editor_view_move_next_search_result_cb (GObject      *object,
     return;
 
   if (gtk_source_search_context_forward_finish2 (context, result, &begin, &end, &has_wrapped, &error))
-    gtk_text_buffer_select_range (GTK_TEXT_BUFFER (self->buffer), &begin, &end);
+    {
+      gtk_text_buffer_select_range (GTK_TEXT_BUFFER (self->buffer), &begin, &end);
+      ide_source_view_scroll_to_insert (self->source_view);
+    }
 }
 
 /**
@@ -1108,7 +1111,10 @@ ide_editor_view_move_previous_search_result_cb (GObject      *object,
     return;
 
   if (gtk_source_search_context_backward_finish2 (context, result, &begin, &end, &has_wrapped, &error))
-    gtk_text_buffer_select_range (GTK_TEXT_BUFFER (self->buffer), &begin, &end);
+    {
+      gtk_text_buffer_select_range (GTK_TEXT_BUFFER (self->buffer), &begin, &end);
+      ide_source_view_scroll_to_insert (self->source_view);
+    }
 }
 
 /**


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