missing refs, slight change to completion provider
authorAlan Knowles <alan@roojs.com>
Tue, 13 Feb 2024 13:33:27 +0000 (21:33 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 13 Feb 2024 13:33:27 +0000 (21:33 +0800)
src/Builder4/Editor.bjs
src/Builder4/Editor.vala
src/Palete/CompletionProvider.vala

index de4f6cb..0033aa4 100644 (file)
     "",
     "\tif (this.searchcontext == null) {",
     "\t\treturn;",
-    "\t} ",
+    "\t}",
     "\t",
     "\tGtk.TextIter beg, st,en;",
     "\tbool has_wrapped_around;",
index e9c403c..8422d9c 100644 (file)
@@ -65,11 +65,13 @@ public class Editor : Object
                this.el.vexpand = true;
                var child_1 = new Xcls_Box1( _this );
                child_1.ref();
+               child_1.ref();
                this.el.append( child_1.el );
                new Xcls_RightEditor( _this );
                this.el.append( _this.RightEditor.el );
                var child_3 = new Xcls_Box11( _this );
                child_3.ref();
+               child_3.ref();
                this.el.append ( child_3.el  );
        }
 
@@ -161,7 +163,7 @@ public class Editor : Object
        
                if (this.searchcontext == null) {
                        return;
-               } 
+               }
                
                Gtk.TextIter beg, st,en;
                bool has_wrapped_around;
@@ -407,9 +409,11 @@ public class Editor : Object
                        this.el.append( _this.save_button.el );
                        var child_2 = new Xcls_Label3( _this );
                        child_2.ref();
+                       child_2.ref();
                        this.el.append( child_2.el );
                        var child_3 = new Xcls_Scale4( _this );
                        child_3.ref();
+                       child_3.ref();
                        this.el.append( child_3.el );
                        new Xcls_close_btn( _this );
                        this.el.append( _this.close_btn.el );
@@ -542,6 +546,7 @@ public class Editor : Object
                        // set gobject values
                        this.el.icon_name = "window-close";
                        var child_1 = new Xcls_Image6( _this );
+                       child_1.ref();
                        this.el.child = child_1.el;
 
                        //listeners
@@ -643,6 +648,7 @@ public class Editor : Object
                        this.el.buffer = _this.buffer.el;
                        var child_2 = new Xcls_EventControllerKey10( _this );
                        child_2.ref();
+                       child_2.ref();
                        this.el.add_controller(  child_2.el );
 
                        // init method
@@ -1173,6 +1179,7 @@ public class Editor : Object
                        this.el.append( _this.backBtn.el );
                        var child_5 = new Xcls_MenuButton17( _this );
                        child_5.ref();
+                       child_5.ref();
                        this.el.append( child_5.el );
                }
 
@@ -1203,6 +1210,7 @@ public class Editor : Object
                        this.el.search_delay = 3;
                        var child_1 = new Xcls_EventControllerKey13( _this );
                        child_1.ref();
+                       child_1.ref();
                        this.el.add_controller(  child_1.el );
 
                        //listeners
@@ -1452,6 +1460,7 @@ public class Editor : Object
 
                        // set gobject values
                        var child_1 = new Xcls_Box19( _this );
+                       child_1.ref();
                        this.el.child = child_1.el;
                }
 
index 5e1a307..8195fc0 100644 (file)
@@ -39,7 +39,14 @@ namespace Palete {
                        if (this.in_populate || ch == 32) {
                                return false;
                        }
-                       GLib.debug("should trigger? %c", (int) ch);
+                       if (this.editor.buffer.el.iter_has_context_class(iter, "comment") ||
+                               this.editor.buffer.el.iter_has_context_class(iter, "string")
+                       ) { 
+                               return false;
+                       }
+                       
+                       
+                       //GLib.debug("should trigger? %c", (int) ch);
                        
                        
                        return true;
@@ -244,6 +251,7 @@ namespace Palete {
                        GLib.debug("pupoulate async  - got reply");
                        this.model = new CompletionModel(this, context, res, cancellable); 
                        var word = context.get_word();
+                       GLib.debug("Context word is %s, %d", word, (int)word.length);
                        
                        
                        var expression = new global::Gtk.PropertyExpression(typeof(CompletionProposal), null, "label");