[gnome-builder] sourceview: advance word completion if already visible



commit 587200300ecf8d61baae39fbc72cf4a638cf790c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 1 18:18:30 2017 -0700

    sourceview: advance word completion if already visible

 libide/sourceview/ide-source-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libide/sourceview/ide-source-view.c b/libide/sourceview/ide-source-view.c
index a93bd0b..5e0d471 100644
--- a/libide/sourceview/ide-source-view.c
+++ b/libide/sourceview/ide-source-view.c
@@ -5062,6 +5062,8 @@ ide_source_view_real_begin_word_completion (IdeSourceView *self,
   GList providers = { 0 };
   GtkTextIter insert;
 
+  IDE_ENTRY;
+
   g_assert (IDE_IS_SOURCE_VIEW (self));
 
   if (direction != 1 && direction != -1)
@@ -5072,6 +5074,13 @@ ide_source_view_real_begin_word_completion (IdeSourceView *self,
 
   completion = gtk_source_view_get_completion (GTK_SOURCE_VIEW (self));
 
+  /* Move to the next row if completion is already visible */
+  if (priv->completion_visible)
+    {
+      g_signal_emit_by_name (completion, "move-cursor", GTK_SCROLL_STEPS, direction);
+      IDE_EXIT;
+    }
+
   if (priv->word_completion_provider == NULL)
     {
       priv->word_completion_provider = g_object_new (IDE_TYPE_WORD_COMPLETION_PROVIDER, NULL);
@@ -5094,6 +5103,8 @@ ide_source_view_real_begin_word_completion (IdeSourceView *self,
 
   providers.data = priv->word_completion_provider;
   gtk_source_completion_show (completion, &providers, cc);
+
+  IDE_EXIT;
 }
 
 static void


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