[gnome-builder] editor: don't wrap manually when searching



commit 0c586b89b72db8ad0cc6f1137e594aa7dd1aba0e
Author: Ray Strode <rstrode redhat com>
Date:   Wed Jan 28 14:11:08 2015 -0500

    editor: don't wrap manually when searching
    
    GtkSourceSearchSettings natively supports wrapping when
    searching if the wrap-around property is set to TRUE.
    
    gb_editor_frame_move_next_match wraps around manually.
    
    This commit deletes the manual code and just sets wrap-around
    to TRUE.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743668

 src/editor/gb-editor-frame.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/src/editor/gb-editor-frame.c b/src/editor/gb-editor-frame.c
index 12b649a..4de039b 100644
--- a/src/editor/gb-editor-frame.c
+++ b/src/editor/gb-editor-frame.c
@@ -167,16 +167,6 @@ gb_editor_frame_move_next_match (GbEditorFrame *self,
                                          &match_begin, &match_end))
     GOTO (found_match);
 
-  /*
-   * Didn't find anything, let's try from the beginning of the buffer.
-   */
-  gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (priv->document),
-                              &select_begin, &select_end);
-
-  if (gtk_source_search_context_forward (priv->search_context, &select_begin,
-                                         &match_begin, &match_end))
-    GOTO (found_match);
-
   gb_editor_frame_restore_position (self);
 
   EXIT;
@@ -1473,6 +1463,7 @@ gb_editor_frame_constructed (GObject *object)
                             -50);
 
   priv->search_settings = g_object_new (GTK_SOURCE_TYPE_SEARCH_SETTINGS,
+                                        "wrap-around", TRUE,
                                         NULL);
   g_object_bind_property (priv->search_entry, "text",
                           priv->search_settings, "search-text",


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