[gtksourceview] region: drop start arg of get_region_iter() and rename function
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] region: drop start arg of get_region_iter() and rename function
- Date: Fri, 1 Apr 2016 18:08:29 +0000 (UTC)
commit 088add57e01dd2f066ddc0e6e1c512805e5f40a5
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Apr 1 20:00:23 2016 +0200
region: drop start arg of get_region_iter() and rename function
.../words/gtksourcecompletionwordsbuffer.c | 12 ++++--------
gtksourceview/gtksourcecontextengine.c | 2 +-
gtksourceview/gtksourceregion.c | 7 +++----
gtksourceview/gtksourceregion.h | 7 +++----
gtksourceview/gtksourcesearchcontext.c | 8 ++++----
testsuite/test-region.c | 4 ++--
6 files changed, 17 insertions(+), 23 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
index 363777b..ab7b8e2 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
@@ -313,7 +313,7 @@ is_text_region_empty (GtkSourceRegion *region)
{
GtkSourceRegionIter region_iter;
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
@@ -346,9 +346,7 @@ idle_scan_regions (GtkSourceCompletionWordsBuffer *buffer)
gtk_text_buffer_get_start_iter (buffer->priv->buffer, &start);
stop = start;
- gtk_source_region_get_region_iter (buffer->priv->scan_region,
- ®ion_iter,
- 0);
+ gtk_source_region_get_start_region_iter (buffer->priv->scan_region, ®ion_iter);
while (nb_remaining_lines > 0 &&
!gtk_source_region_iter_is_end (®ion_iter))
@@ -442,7 +440,7 @@ remove_words_in_region (GtkSourceCompletionWordsBuffer *buffer,
{
GtkSourceRegionIter region_iter;
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
@@ -471,9 +469,7 @@ compute_remove_region (GtkSourceCompletionWordsBuffer *buffer,
gtk_source_region_add (remove_region, start, end);
- gtk_source_region_get_region_iter (buffer->priv->scan_region,
- ®ion_iter,
- 0);
+ gtk_source_region_get_start_region_iter (buffer->priv->scan_region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 09da0eb..007c360 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -954,7 +954,7 @@ ensure_highlighted (GtkSourceContextEngine *ce,
if (region == NULL)
return;
- gtk_source_region_get_region_iter (region, ®_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®_iter);
/* Highlight all subregions from the intersection.
* hopefully this will only be one subregion. */
diff --git a/gtksourceview/gtksourceregion.c b/gtksourceview/gtksourceregion.c
index 9028976..aa8a3b2 100644
--- a/gtksourceview/gtksourceregion.c
+++ b/gtksourceview/gtksourceregion.c
@@ -707,9 +707,8 @@ check_iterator (GtkSourceRegionIterReal *real)
}
void
-gtk_source_region_get_region_iter (GtkSourceRegion *region,
- GtkSourceRegionIter *iter,
- guint start)
+gtk_source_region_get_start_region_iter (GtkSourceRegion *region,
+ GtkSourceRegionIter *iter)
{
GtkSourceRegionIterReal *real;
@@ -721,7 +720,7 @@ gtk_source_region_get_region_iter (GtkSourceRegion *region,
/* region->subregions may be NULL, -> end iter */
real->region = region;
- real->subregions = g_list_nth (region->subregions, start);
+ real->subregions = region->subregions;
real->region_timestamp = region->timestamp;
}
diff --git a/gtksourceview/gtksourceregion.h b/gtksourceview/gtksourceregion.h
index 304eeb2..4d41000 100644
--- a/gtksourceview/gtksourceregion.h
+++ b/gtksourceview/gtksourceregion.h
@@ -34,7 +34,7 @@ typedef struct _GtkSourceRegionIter GtkSourceRegionIter;
struct _GtkSourceRegionIter
{
/* GtkSourceRegionIter is an opaque datatype; ignore all these fields.
- * Initialize the iter with gtk_source_region_get_region_iter
+ * Initialize the iter with gtk_source_region_get_start_region_iter
* function
*/
/*< private >*/
@@ -77,9 +77,8 @@ gboolean gtk_source_region_nth_subregion (GtkSourceRegion *region,
GtkTextIter *end);
GTK_SOURCE_INTERNAL
-void gtk_source_region_get_region_iter (GtkSourceRegion *region,
- GtkSourceRegionIter *iter,
- guint start);
+void gtk_source_region_get_start_region_iter (GtkSourceRegion *region,
+ GtkSourceRegionIter *iter);
GTK_SOURCE_INTERNAL
gboolean gtk_source_region_iter_is_end (GtkSourceRegionIter *iter);
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 9fd2718..23f8a55 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -433,7 +433,7 @@ is_text_region_empty (GtkSourceRegion *region)
return TRUE;
}
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
@@ -473,7 +473,7 @@ get_first_subregion (GtkSourceRegion *region,
return FALSE;
}
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
@@ -509,7 +509,7 @@ get_last_subregion (GtkSourceRegion *region,
return FALSE;
}
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
@@ -1852,7 +1852,7 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
&start,
&end);
- gtk_source_region_get_region_iter (region, ®ion_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
{
diff --git a/testsuite/test-region.c b/testsuite/test-region.c
index c71fde4..734179a 100644
--- a/testsuite/test-region.c
+++ b/testsuite/test-region.c
@@ -96,7 +96,7 @@ test_region (void)
gtk_text_buffer_get_start_iter (buffer, &iter1);
gtk_text_buffer_insert (buffer, &iter1, "This is a test of GtkSourceRegion", -1);
- gtk_source_region_get_region_iter (region, ®_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®_iter);
if (!gtk_source_region_iter_is_end (®_iter)) {
g_print ("problem fetching iterator for an empty region\n");
g_assert_not_reached ();
@@ -135,7 +135,7 @@ test_region (void)
}
i = 0;
- gtk_source_region_get_region_iter (region, ®_iter, 0);
+ gtk_source_region_get_start_region_iter (region, ®_iter);
while (!gtk_source_region_iter_is_end (®_iter))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]