src/Builder4/Editor.bjs
[app.Builder.js] / src / Builder4 / Editor.vala
index 8243a30..fe53b25 100644 (file)
@@ -119,19 +119,18 @@ public class Editor : Object
     
        var s = new Gtk.SourceSearchSettings();
        
-       this.sourcecontext = new Gtk.SourceSearchContext(this.buffer.el,s);
-       this.sourcecontext .set_highlight(true);
+       this.searchcontext = new Gtk.SourceSearchContext(this.buffer.el,s);
+       this.searchcontext .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();
+       Gtk.TextIter beg, st,en;
+        
+       this.buffer.el.get_start_iter(out beg);
+       this.searchcontext.forward(beg, out st, out en);
+       
+       
+       return this.searchcontext.get_occurrences_count();
     
+     
        
     
     }
@@ -141,7 +140,7 @@ public class Editor : Object
         this.ptype = "";
         this.key  = "";
         this.node = null;
-    
+       this.searchcontext = null;
         
         if (file.xtype != "PlainFile") {
         
@@ -166,6 +165,9 @@ public class Editor : Object
         }
     
            
+    }
+    public void forwardSearch () {
+    
     }
     public class Xcls_Box2 : Object
     {