[gnome-builder] source-view: block completion while loading
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] source-view: block completion while loading
- Date: Thu, 9 Apr 2015 23:44:26 +0000 (UTC)
commit d7ac6893b472ce0d895c4e7456d2f47c335a045d
Author: Christian Hergert <christian hergert me>
Date: Thu Apr 9 16:43:52 2015 -0700
source-view: block completion while loading
Completion is getting spuriously activated during loading of the buffer.
This blocks it while we do so.
GSV team: perhaps we should do this in GtkSourceFileLoader? If that is
the case, we can revert this once it is upstream.
libide/ide-source-view.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index afacf34..0bb3e03 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -111,12 +111,12 @@ typedef struct
gulong buffer_insert_text_after_handler;
gulong buffer_insert_text_handler;
gulong buffer_line_flags_changed_handler;
+ gulong buffer_loaded_handler;
gulong buffer_mark_set_handler;
gulong buffer_notify_file_handler;
gulong buffer_notify_highlight_diagnostics_handler;
gulong buffer_notify_language_handler;
gulong buffer_notify_style_scheme_handler;
- gulong buffer_loaded_handler;
guint change_sequence;
@@ -137,6 +137,7 @@ typedef struct
GdkRGBA bubble_color2;
guint auto_indent : 1;
+ guint completion_blocked : 1;
guint completion_visible : 1;
guint enable_word_completion : 1;
guint highlight_current_line : 1;
@@ -1325,6 +1326,15 @@ ide_source_view__buffer_loaded_cb (IdeSourceView *self,
g_assert (IDE_IS_SOURCE_VIEW (self));
g_assert (IDE_IS_BUFFER (buffer));
+ if (priv->completion_blocked)
+ {
+ GtkSourceCompletion *completion;
+
+ completion = gtk_source_view_get_completion (GTK_SOURCE_VIEW (self));
+ gtk_source_completion_unblock_interactive (completion);
+ priv->completion_blocked = FALSE;
+ }
+
/*
* FIXME:
*
@@ -1356,6 +1366,15 @@ ide_source_view_connect_buffer (IdeSourceView *self,
g_assert (IDE_IS_SOURCE_VIEW (self));
g_assert (IDE_IS_BUFFER (buffer));
+ if (_ide_buffer_get_loading (buffer))
+ {
+ GtkSourceCompletion *completion;
+
+ completion = gtk_source_view_get_completion (GTK_SOURCE_VIEW (self));
+ gtk_source_completion_block_interactive (completion);
+ priv->completion_blocked = TRUE;
+ }
+
priv->buffer_changed_handler =
g_signal_connect_object (buffer,
"changed",
@@ -1501,6 +1520,15 @@ ide_source_view_disconnect_buffer (IdeSourceView *self,
ide_clear_signal_handler (buffer, &priv->buffer_notify_style_scheme_handler);
ide_clear_signal_handler (buffer, &priv->buffer_loaded_handler);
+ if (priv->completion_blocked)
+ {
+ GtkSourceCompletion *completion;
+
+ completion = gtk_source_view_get_completion (GTK_SOURCE_VIEW (self));
+ gtk_source_completion_unblock_interactive (completion);
+ priv->completion_blocked = FALSE;
+ }
+
g_clear_object (&priv->search_context);
ide_source_view_set_indenter (self, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]