[gtksourceview/wip/chergert/gsv-gtk4: 254/259] tests: use C as language for completion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/gsv-gtk4: 254/259] tests: use C as language for completion
- Date: Mon, 21 Sep 2020 23:27:49 +0000 (UTC)
commit a140e01f530b3b65af62d2e2cb3d401f634ac5f1
Author: Christian Hergert <chergert redhat com>
Date: Thu Sep 10 14:46:34 2020 -0700
tests: use C as language for completion
tests/test-completion.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/tests/test-completion.c b/tests/test-completion.c
index 357f0f2c..6fb62c23 100644
--- a/tests/test-completion.c
+++ b/tests/test-completion.c
@@ -520,9 +520,12 @@ create_completion (GtkSourceView *source_view,
static void
create_window (void)
{
+ GtkSourceLanguageManager *lm = gtk_source_language_manager_get_default ();
+ GtkSourceLanguage *l = gtk_source_language_manager_get_language (lm, "c");
GtkBuilder *builder;
GError *error = NULL;
GtkWindow *window;
+ GtkTextBuffer *buffer;
GtkSourceView *source_view;
GtkSourceCompletion *completion;
GtkCheckButton *remember_info_visibility;
@@ -558,6 +561,8 @@ create_window (void)
nb_fixed_proposals = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
"spinbutton_nb_fixed_proposals"));
nb_random_proposals = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
"spinbutton_nb_random_proposals"));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (source_view));
+ gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (buffer), l);
gtk_source_view_set_enable_snippets (source_view, TRUE);
completion = gtk_source_view_get_completion (source_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]