[gtksourceview] SearchContext: rename replace2() -> replace()



commit fa878729e1d00b603eeb1c2e271d0f37c79e3057
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Nov 15 18:25:13 2016 +0100

    SearchContext: rename replace2() -> replace()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773249

 docs/reference/gtksourceview-4.0-sections.txt |    2 +-
 gtksourceview/gtksourcesearchcontext.c        |   16 ++++++++--------
 gtksourceview/gtksourcesearchcontext.h        |    2 +-
 tests/test-search.c                           |   12 ++++++------
 testsuite/test-search-context.c               |   14 +++++++-------
 5 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/docs/reference/gtksourceview-4.0-sections.txt b/docs/reference/gtksourceview-4.0-sections.txt
index 9628855..cd404c5 100644
--- a/docs/reference/gtksourceview-4.0-sections.txt
+++ b/docs/reference/gtksourceview-4.0-sections.txt
@@ -688,7 +688,7 @@ gtk_source_search_context_forward_finish
 gtk_source_search_context_backward
 gtk_source_search_context_backward_async
 gtk_source_search_context_backward_finish
-gtk_source_search_context_replace2
+gtk_source_search_context_replace
 gtk_source_search_context_replace_all
 gtk_source_search_context_get_regex_error
 <SUBSECTION Standard>
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 13c8599..72879ab 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -62,7 +62,7 @@
  * To search forward, use gtk_source_search_context_forward() or
  * gtk_source_search_context_forward_async() for the asynchronous version.
  * The backward search is done similarly. To replace a search match, or all
- * matches, use gtk_source_search_context_replace2() and
+ * matches, use gtk_source_search_context_replace() and
  * gtk_source_search_context_replace_all().
  *
  * The search occurrences are highlighted by default. To disable it, use
@@ -3623,7 +3623,7 @@ end:
 }
 
 /**
- * gtk_source_search_context_replace2:
+ * gtk_source_search_context_replace:
  * @search: a #GtkSourceSearchContext.
  * @match_start: the start of the match to replace.
  * @match_end: the end of the match to replace.
@@ -3645,12 +3645,12 @@ end:
  * Since: 3.22
  */
 gboolean
-gtk_source_search_context_replace2 (GtkSourceSearchContext  *search,
-                                   GtkTextIter             *match_start,
-                                   GtkTextIter             *match_end,
-                                   const gchar             *replace,
-                                   gint                     replace_length,
-                                   GError                 **error)
+gtk_source_search_context_replace (GtkSourceSearchContext  *search,
+                                  GtkTextIter             *match_start,
+                                  GtkTextIter             *match_end,
+                                  const gchar             *replace,
+                                  gint                     replace_length,
+                                  GError                 **error)
 {
        GtkTextIter start;
        GtkTextIter end;
diff --git a/gtksourceview/gtksourcesearchcontext.h b/gtksourceview/gtksourcesearchcontext.h
index 8b8dc6f..21ff1f8 100644
--- a/gtksourceview/gtksourcesearchcontext.h
+++ b/gtksourceview/gtksourcesearchcontext.h
@@ -138,7 +138,7 @@ gboolean             gtk_source_search_context_backward_finish              
(GtkSourceSearchContext  *
                                                                                 GError                 
**error);
 
 GTK_SOURCE_AVAILABLE_IN_3_22
-gboolean                gtk_source_search_context_replace2                     (GtkSourceSearchContext  
*search,
+gboolean                gtk_source_search_context_replace                      (GtkSourceSearchContext  
*search,
                                                                                 GtkTextIter             
*match_start,
                                                                                 GtkTextIter             
*match_end,
                                                                                 const gchar             
*replace,
diff --git a/tests/test-search.c b/tests/test-search.c
index b288456..e8f0b18 100644
--- a/tests/test-search.c
+++ b/tests/test-search.c
@@ -268,12 +268,12 @@ button_replace_clicked_cb (TestSearch *search,
        entry_buffer = gtk_entry_get_buffer (search->priv->replace_entry);
        replace_length = gtk_entry_buffer_get_bytes (entry_buffer);
 
-       gtk_source_search_context_replace2 (search->priv->search_context,
-                                           &match_start,
-                                           &match_end,
-                                           gtk_entry_get_text (search->priv->replace_entry),
-                                           replace_length,
-                                           NULL);
+       gtk_source_search_context_replace (search->priv->search_context,
+                                          &match_start,
+                                          &match_end,
+                                          gtk_entry_get_text (search->priv->replace_entry),
+                                          replace_length,
+                                          NULL);
 
        gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (search->priv->source_buffer),
                                              NULL,
diff --git a/testsuite/test-search-context.c b/testsuite/test-search-context.c
index 3a7f91d..ce9e267 100644
--- a/testsuite/test-search-context.c
+++ b/testsuite/test-search-context.c
@@ -918,13 +918,13 @@ test_replace (void)
        gtk_text_buffer_get_iter_at_offset (text_buffer, &start, 1);
        gtk_text_buffer_get_iter_at_offset (text_buffer, &end, 3);
 
-       replaced = gtk_source_search_context_replace2 (context, &start, &end, "bbb", -1, NULL);
+       replaced = gtk_source_search_context_replace (context, &start, &end, "bbb", -1, NULL);
        g_assert (!replaced);
 
        gtk_text_buffer_get_iter_at_offset (text_buffer, &start, 2);
        gtk_text_buffer_get_iter_at_offset (text_buffer, &end, 4);
 
-       replaced = gtk_source_search_context_replace2 (context, &start, &end, "bbb", -1, NULL);
+       replaced = gtk_source_search_context_replace (context, &start, &end, "bbb", -1, NULL);
        g_assert (replaced);
        offset = gtk_text_iter_get_offset (&start);
        g_assert_cmpint (offset, ==, 2);
@@ -1006,7 +1006,7 @@ test_regex_basics (void)
 
        gtk_text_buffer_get_start_iter (text_buffer, &start);
        gtk_text_buffer_get_end_iter (text_buffer, &end);
-       gtk_source_search_context_replace2 (context, &start, &end, "\\2#\\1", -1, NULL);
+       gtk_source_search_context_replace (context, &start, &end, "\\2#\\1", -1, NULL);
        g_assert (gtk_text_iter_is_start (&start));
        g_assert (gtk_text_iter_is_end (&end));
 
@@ -1086,7 +1086,7 @@ test_regex_at_word_boundaries (void)
 
        gtk_text_buffer_get_iter_at_offset (text_buffer, &match_start, 1);
        gtk_text_buffer_get_end_iter (text_buffer, &match_end);
-       gtk_source_search_context_replace2 (context, &match_start, &match_end, "bbb", -1, NULL);
+       gtk_source_search_context_replace (context, &match_start, &match_end, "bbb", -1, NULL);
        offset = gtk_text_iter_get_offset (&match_start);
        g_assert_cmpint (offset, ==, 1);
        g_assert (gtk_text_iter_is_end (&match_end));
@@ -1103,7 +1103,7 @@ test_regex_at_word_boundaries (void)
 
        gtk_text_buffer_get_iter_at_offset (text_buffer, &match_start, 1);
        gtk_text_buffer_get_end_iter (text_buffer, &match_end);
-       gtk_source_search_context_replace2 (context, &match_start, &match_end, "bbb", -1, NULL);
+       gtk_source_search_context_replace (context, &match_start, &match_end, "bbb", -1, NULL);
        offset = gtk_text_iter_get_offset (&match_start);
        g_assert_cmpint (offset, ==, 1);
        g_assert (gtk_text_iter_is_end (&match_end));
@@ -1180,7 +1180,7 @@ test_regex_look_behind (void)
        g_assert_cmpint (pos, ==, 1);
 
        /* Replace */
-       gtk_source_search_context_replace2 (context, &match_start, &match_end, "R", -1, &error);
+       gtk_source_search_context_replace (context, &match_start, &match_end, "R", -1, &error);
        g_assert_no_error (error);
 
        contents = get_buffer_contents (text_buffer);
@@ -1266,7 +1266,7 @@ test_regex_look_ahead (void)
        g_assert_cmpint (pos, ==, 1);
 
        /* Replace */
-       gtk_source_search_context_replace2 (context, &match_start, &match_end, "R", -1, &error);
+       gtk_source_search_context_replace (context, &match_start, &match_end, "R", -1, &error);
        g_assert_no_error (error);
 
        contents = get_buffer_contents (text_buffer);


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