src/Builder4/ValaCompileErrors.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 11:16:14 +0000 (19:16 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 11:16:14 +0000 (19:16 +0800)
src/Builder4/ValaCompileErrors.vala

src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala

index 5644864..4839ae0 100644 (file)
@@ -53,7 +53,7 @@
        "items" : [
         {
          "listeners" : {
-          "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        \n        return false; //not on a element.\n    }\n    \n     \n     // right click.\n     if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    \n        // show popup!.   \n            \n         \n        return false;\n    }\n    Gtk.TreeIter iter;\n     var mod = _this.compile_result_store.el;\n    mod.get_iter (out iter, path);\n    \n      \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    //GLib.Value lvalue;\n    //_this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    //var line = (int) lvalue;\n    \n    \n   var  bjsf = \"\";\n    try {             \n       var  regex = new Regex(\"\\\\.vala$\");\n    \n     \n        bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n     } catch (GLib.RegexError e) {\n        return false;\n    }   \n    var p = _this.window.project;\n        \n        \n        \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr);\n        \n        return false;\n    \n    }\n    \n    var pf = JsRender.JsRender.factory(\"PlainFile\", p, fname);\n    _this.window.windowstate.fileViewOpen(pf);\n    \n    // try hiding the left nav..\n \n    return false;\n    \n  }\n    "
+          "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        \n        return false; //not on a element.\n    }\n    \n     \n     // right click.\n     if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    \n        // show popup!.   \n            \n         \n        return false;\n    }\n    Gtk.TreeIter iter;\n     var mod = _this.compile_result_store.el;\n    mod.get_iter (out iter, path);\n    \n      \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    GLib.Value lvalue;\n    _this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    var line = (int) lvalue;\n    \n    \n   var  bjsf = \"\";\n    try {             \n       var  regex = new Regex(\"\\\\.vala$\");\n    \n     \n        bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n     } catch (GLib.RegexError e) {\n        return false;\n    }   \n    var p = _this.window.project;\n        \n        \n        \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr, line);\n        \n        return false;\n    \n    }\n    \n    var pf = JsRender.JsRender.factory(\"PlainFile\", p, fname, line);\n    _this.window.windowstate.fileViewOpen(pf);\n    \n    // try hiding the left nav..\n \n    return false;\n    \n  }\n    "
          },
          "id" : "compile_tree",
          "* init" : "{\n var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.override_font(description);\n\n}\n",
index 4cbf543..d5c2dbd 100644 (file)
@@ -290,9 +290,9 @@ public class Xcls_ValaCompileErrors : Object
                 GLib.Value value;
                 _this.compile_result_store.el.get_value(iter, 3, out value);
                 var fname = (string)value;
-                //GLib.Value lvalue;
-                //_this.compile_result_store.el.get_value(iter, 1, out lvalue);
-                //var line = (int) lvalue;
+                GLib.Value lvalue;
+                _this.compile_result_store.el.get_value(iter, 1, out lvalue);
+                var line = (int) lvalue;
                 
                 
                var  bjsf = "";
@@ -310,13 +310,13 @@ public class Xcls_ValaCompileErrors : Object
                     
                 var jsr = p.getByPath(bjsf);
                 if (jsr != null) {
-                    _this.window.windowstate.fileViewOpen(jsr);
+                    _this.window.windowstate.fileViewOpen(jsr, line);
                     
                     return false;
                 
                 }
                 
-                var pf = JsRender.JsRender.factory("PlainFile", p, fname);
+                var pf = JsRender.JsRender.factory("PlainFile", p, fname, line);
                 _this.window.windowstate.fileViewOpen(pf);
                 
                 // try hiding the left nav..