[gnome-builder/wip/libide] libide: don't move unless we find a match
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: don't move unless we find a match
- Date: Wed, 11 Mar 2015 05:40:43 +0000 (UTC)
commit 7a44185b93b03149d97288ac54ba3213ad3044fd
Author: Christian Hergert <christian hergert me>
Date: Tue Mar 10 22:40:33 2015 -0700
libide: don't move unless we find a match
libide/ide-source-view-movements.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-source-view-movements.c b/libide/ide-source-view-movements.c
index 86096c1..3f5bc46 100644
--- a/libide/ide-source-view-movements.c
+++ b/libide/ide-source-view-movements.c
@@ -1110,18 +1110,24 @@ ide_source_view_movements_previous_unmatched (Movement *mv,
gunichar target,
gunichar opposite)
{
+ GtkTextIter copy;
guint count = 1;
g_assert (mv);
g_assert (target);
g_assert (opposite);
+ copy = mv->insert;
+
do
{
gunichar ch;
if (!gtk_text_iter_backward_char (&mv->insert))
- return;
+ {
+ mv->insert = copy;
+ return;
+ }
ch = gtk_text_iter_get_char (&mv->insert);
@@ -1147,18 +1153,24 @@ ide_source_view_movements_next_unmatched (Movement *mv,
gunichar target,
gunichar opposite)
{
+ GtkTextIter copy;
guint count = 1;
g_assert (mv);
g_assert (target);
g_assert (opposite);
+ copy = mv->insert;
+
do
{
gunichar ch;
if (!gtk_text_iter_forward_char (&mv->insert))
- return;
+ {
+ mv->insert = copy;
+ return;
+ }
ch = gtk_text_iter_get_char (&mv->insert);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]