[gnome-builder] update saved position when navigating search results (and not focused)
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] update saved position when navigating search results (and not focused)
- Date: Tue, 24 Mar 2015 00:29:07 +0000 (UTC)
commit cae1194bfcb1dbe14361c833a30bdb3725831281
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 19 20:35:59 2015 -0700
update saved position when navigating search results (and not focused)
this happens from the search box
libide/ide-source-view.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 2e95679..e0ee114 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -227,9 +227,11 @@ enum {
static GParamSpec *gParamSpecs [LAST_PROP];
static guint gSignals [LAST_SIGNAL];
-static void ide_source_view_real_set_mode (IdeSourceView *self,
- const gchar *name,
- IdeSourceViewModeType type);
+static void ide_source_view_real_save_insert_mark (IdeSourceView *self);
+static void ide_source_view_real_restore_insert_mark (IdeSourceView *self);
+static void ide_source_view_real_set_mode (IdeSourceView *self,
+ const gchar *name,
+ IdeSourceViewModeType type);
static SearchMovement *
search_movement_ref (SearchMovement *movement)
@@ -3100,6 +3102,10 @@ ide_source_view__search_forward_cb (GObject *object,
else
gtk_text_buffer_select_range (buffer, &begin, &begin);
+ /* if we arent focused, update the saved position marker */
+ if (!gtk_widget_has_focus (GTK_WIDGET (mv->self)))
+ ide_source_view_real_save_insert_mark (mv->self);
+
ide_source_view_scroll_mark_onscreen (mv->self, insert);
}
@@ -3152,6 +3158,10 @@ ide_source_view__search_backward_cb (GObject *object,
else
gtk_text_buffer_select_range (buffer, &begin, &begin);
+ /* if we arent focused, update the saved position marker */
+ if (!gtk_widget_has_focus (GTK_WIDGET (mv->self)))
+ ide_source_view_real_save_insert_mark (mv->self);
+
ide_source_view_scroll_mark_onscreen (mv->self, insert);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]