[gnome-builder] editor: stub out location for snippet variable loading.



commit 5e36e308657b522cdc3c05228056391085511375
Author: Christian Hergert <christian hergert me>
Date:   Sun Sep 7 23:38:40 2014 -0700

    editor: stub out location for snippet variable loading.

 src/editor/gb-editor-tab.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-tab.c b/src/editor/gb-editor-tab.c
index 66f8e37..36501df 100644
--- a/src/editor/gb-editor-tab.c
+++ b/src/editor/gb-editor-tab.c
@@ -1098,6 +1098,25 @@ on_source_view_populate_popup (GtkTextView *text_view,
 }
 
 static void
+on_source_view_push_snippet (GbSourceView           *source_view,
+                             GbSourceSnippet        *snippet,
+                             GbSourceSnippetContext *context,
+                             GtkTextIter            *iter,
+                             GbEditorTab            *tab)
+{
+  g_return_if_fail (GB_IS_SOURCE_VIEW (source_view));
+  g_return_if_fail (GB_IS_SOURCE_SNIPPET (snippet));
+  g_return_if_fail (GB_IS_SOURCE_SNIPPET_CONTEXT (context));
+  g_return_if_fail (iter);
+  g_return_if_fail (GB_IS_EDITOR_TAB (tab));
+
+  /*
+   * TODO: Get filename from GtkSourceFile.
+   */
+  gb_source_snippet_context_add_variable (context, "filename", "");
+}
+
+static void
 gb_editor_tab_constructed (GObject *object)
 {
   GtkSourceCompletion *comp;
@@ -1134,6 +1153,10 @@ gb_editor_tab_constructed (GObject *object)
                     "populate-popup",
                     G_CALLBACK (on_source_view_populate_popup),
                     tab);
+  g_signal_connect (priv->source_view,
+                    "push-snippet",
+                    G_CALLBACK (on_source_view_push_snippet),
+                    tab);
 
   g_signal_connect_swapped (priv->go_down_button,
                             "clicked",


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