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

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

index b9819d7..c729e78 100644 (file)
@@ -27,7 +27,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\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t} else { \n\t\tthis.last_search_end = en.get_offset();\n\t\n\t\tthis.sourceview.el.grab_focus();\n\t\tbuf.place_cursor(st);\n\t\tthis.sourceview.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.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t} else { \n\t\tthis.last_search_end = en.get_offset();\n\t\n\t\tthis.sourceview.el.grab_focus();\n\t\tthis.allow_node_scroll = false;\n\t\tbuf.place_cursor(st);\n\t\tthis.allow_node_scroll = true;\n\t\tthis.sourceview.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);\n\t}\n\n}\n",
    "items" : [
     {
      "id" : "notebook",
index 266057c..7cfe1d3 100644 (file)
@@ -206,7 +206,9 @@ public class Xcls_GtkView : Object
                this.last_search_end = en.get_offset();
        
                this.sourceview.el.grab_focus();
+               this.allow_node_scroll = false;
                buf.place_cursor(st);
+               this.allow_node_scroll = true;
                this.sourceview.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
        }