diff options
author | Christian Hergert <chergert@redhat.com> | 2023-02-17 22:57:03 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2023-02-17 22:57:03 -0800 |
commit | db9ef36dcaf221ea6b3968c0e1dbab32bec7bc89 (patch) | |
tree | 3f182e03cf79836316d519ca861335f5dc33e85d | |
parent | 9e8d9e16afd15f37b8b7873d6dd21096767b94e7 (diff) | |
download | gtksourceview-db9ef36dcaf221ea6b3968c0e1dbab32bec7bc89.tar.gz |
completion: requery upon user-activation
If the user requests completion manually, then re-query the various
providers. Some providers may have short-circuited on interactive
completion requests but will complete if user-requested.
-rw-r--r-- | gtksourceview/gtksourcecompletion.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c index f3a23eb0..4d56db23 100644 --- a/gtksourceview/gtksourcecompletion.c +++ b/gtksourceview/gtksourcecompletion.c @@ -647,14 +647,14 @@ gtk_source_completion_real_show (GtkSourceCompletion *self) display = _gtk_source_completion_get_display (self); - if (self->context == NULL) - { - gtk_source_completion_start (self, GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED, FALSE); - } - else - { - gtk_source_completion_update (self, GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED, FALSE); - } + /* If the user is requesting completion manually, we should throw away + * our previous results and attempt completion over. Otherwise, providers + * which bailed because they were in _INTERACTIVE_ mode will not be + * requeried for updated results. + */ + g_clear_object (&self->context); + + gtk_source_completion_start (self, GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED, FALSE); _gtk_source_completion_list_set_context (display, self->context); |