src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 13:21:58 +0000 (21:21 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 13:21:58 +0000 (21:21 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 845a72c..f89a199 100644 (file)
@@ -26,7 +26,7 @@
    "$ xns" : "Gtk",
    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "# Xcls_MainWindow main_window" : "",
-   "| void forwardSearch" : "() {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\t\n\tGtk.TextIter beg, st,en;\n\t \n\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);\n\tthis.searchcontext.forward(beg, out st, out en);\n\tthis.last_search_end = en.get_offset();\n\t\n\tthis.view.el.grab_focus();\n\tthis.buffer.el.place_cursor(st);\n\tthis.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);\n\t\n\n}\n",
+   "| void forwardSearch" : "() {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\t\n\tGtk.TextIter beg, st,en;\n\t\n\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.el.get_iter_at_offset(out beg, this.last_search_end);\n\tthis.searchcontext.forward(beg, out st, out en);\n\tthis.last_search_end = en.get_offset();\n\t\n\tthis.sourceview.el.grab_focus();\n\tbuf.el.place_cursor(st);\n\tthis.sourceview.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);\n\t\n\n}\n",
    "items" : [
     {
      "id" : "notebook",
index 5380003..ab3fd29 100644 (file)
@@ -195,14 +195,15 @@ public class Xcls_GtkView : Object
        }
        
        Gtk.TextIter beg, st,en;
-        
-       this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
+       
+       var buf = this.sourceview.el.get_buffer();
+       buf.el.get_iter_at_offset(out beg, this.last_search_end);
        this.searchcontext.forward(beg, out st, out en);
        this.last_search_end = en.get_offset();
        
-       this.view.el.grab_focus();
-       this.buffer.el.place_cursor(st);
-       this.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
+       this.sourceview.el.grab_focus();
+       buf.el.place_cursor(st);
+       this.sourceview.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
        
     
     }