src/Palete/Palete.vala
[app.Builder.js] / src / Palete / CompletionProvider.vala
index 279e342..36b9c99 100644 (file)
@@ -36,7 +36,7 @@ namespace Palete {
 
                public List<SourceCompletionItem>? fetchMatches(SourceCompletionContext context, out bool has_matches)
                {
-                   var has_matches = false;
+                    has_matches = false;
 
                    if (this.windowstate == null) {
                            this.windowstate = this.editor.window.windowstate;
@@ -86,12 +86,17 @@ namespace Palete {
        
                public void populate (SourceCompletionContext context)
                {
-                       this.fetchMatches(context, out has_matches);
+                       bool has_matches = false;
+                       var filtered_proposals = this.fetchMatches(context, out has_matches);
                        if (!has_matches) {
-                                   return;
+                           context.add_proposals (this, null, true);
+                           return;
                        }
-                        
+                       // add proposals triggers a critical error in Gtk - try running gtksourceview/tests/test-completion.
+                       // see https://bugzilla.gnome.org/show_bug.cgi?id=758646
+                       var fe = GLib.Log.set_always_fatal(0); 
                        context.add_proposals (this, filtered_proposals, true);
+                       GLib.Log.set_always_fatal(fe);
                }
 
 
@@ -157,3 +162,4 @@ namespace Palete {
 
 
 } 
+