src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 12:54:48 +0000 (20:54 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 12:54:48 +0000 (20:54 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index 3b5460a..adb7961 100644 (file)
@@ -16,7 +16,7 @@
    "# int pos_root_y" : "",
    "# string ptype" : "\"\"",
    "bool hexpand" : true,
-   "| int search" : "(string txt) {\n\n\tvar s = new Gtk.SourceSearchSettings();\n\t\n\tthis.sourcecontext = new Gtk.SourceSearchContext(this.buffer.el,s);\n\tsctx.set_highlight(true);\n\ts.set_search_text(txt);\n\treturn this.sourcecontext.get_occurences_count();\n\n}\n",
+   "| int search" : "(string txt) {\n\n\tvar s = new Gtk.SourceSearchSettings();\n\t\n\tthis.sourcecontext = new Gtk.SourceSearchContext(this.buffer.el,s);\n\tthis.sourcecontext .set_highlight(true);\n\ts.set_search_text(txt);\n\treturn this.sourcecontext.get_occurences_count();\n\n\n\tvar s = new Gtk.SourceSearchSettings();\n\tvar buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();\n\tthis.sourcecontext = new Gtk.SourceSearchContext(buf,s);\n\tthis.sourcecontext.set_highlight(true);\n\ts.set_search_text(txt);\n\treturn this.sourcecontext.get_occurrences_count();\n\n   \n\n}\n",
    "# string key" : "\"\"",
    "* pack" : "add",
    "xtype" : "Box",
index 9ff8682..8243a30 100644 (file)
@@ -120,10 +120,20 @@ public class Editor : Object
        var s = new Gtk.SourceSearchSettings();
        
        this.sourcecontext = new Gtk.SourceSearchContext(this.buffer.el,s);
-       sctx.set_highlight(true);
+       this.sourcecontext .set_highlight(true);
        s.set_search_text(txt);
        return this.sourcecontext.get_occurences_count();
     
+    
+       var s = new Gtk.SourceSearchSettings();
+       var buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();
+       this.sourcecontext = new Gtk.SourceSearchContext(buf,s);
+       this.sourcecontext.set_highlight(true);
+       s.set_search_text(txt);
+       return this.sourcecontext.get_occurrences_count();
+    
+       
+    
     }
     public   void show (JsRender.JsRender file, JsRender.Node? node, string ptype, string key)
     {