src/Builder4/WindowRooView.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 28 Jul 2016 09:30:49 +0000 (17:30 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 Jul 2016 09:30:49 +0000 (17:30 +0800)
src/Builder4/WindowRooView.vala

src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala

index 4e09f52..62b1d92 100644 (file)
          "items" : [
           {
            "listeners" : {
-            "changed" : " () => {\n \n\n    // check syntax??\n    // ??needed..??\n   // _this.save_button.el.sensitive = true;\n    ///?? has changed occured during loading?\n    \n    // only trigger this if \n    \n    \n    \n    \n    if (_this.sourceview.loading) {\n\t\treturn;\n\t}\n\t\n\n\t\n    print(\"- PREVIEW EDITOR CHANGED--\");\n\n    this.dirty = true;  \n    this.checkSyntax(); // this calls backs and highlights errors.. in theory...  \n\n\n\n\tif (!_this.sourceview.button_is_pressed && !_this.sourceview.key_is_pressed) {\n\t\tprint(\"button or key not pressed to generate change?!\\n\");\n\t\treturn;\n\t}\n\t\t\n    \n\t// what are we editing??\n\tif (null == _this.sourceview.node_selected || _this.sourceview.prop_selected.length  < 1) {\n\t\treturn;\n\t}\n\t\n\t// find the colon on the first line...\n\t\n\tif (_this.sourceview.editable_start_pos > -1) {\n\t\t\n\t\tvar buf = (Gtk.SourceBuffer)_this.sourceview.el.get_buffer();\n\t\t\n        //print(\"cursor changed : %d\\n\", buf.cursor_position);\n        Gtk.TextIter spos,epos;\n        buf.get_iter_at_offset(out spos, _this.sourceview.editable_start_pos);\n        buf.get_iter_at_offset(out epos, _this.sourceview.editable_start_pos); // initialize epos..\n        \n        var gotit= false;\n        var line = spos.get_line();\n        var endline = buf.get_line_count();\n        while (line < endline) {\n    \t\tline++;\n\t        buf.get_iter_at_line(out epos, line);\n\t        if (buf.get_source_marks_at_line(line, \"grey\")) {\n\t\t        buf.get_iter_at_line(out epos, line);\t    \t\t\n\t    \t\tgotit=true;\n\t    \t\tbreak;\n    \t\t}\n\t\t}\n        \n \t\tif (gotit) {\n\t \t\tprint(\"End Offset = %d/%d\\n\", epos.get_line(), epos.get_offset());\n\t\t\t// get the pos...\n\t\t\t// in theory the last char will be '}' or '},' .. or ','\n\t\t\t// we should chop the ',' of the end...\n\t\t\tvar str = buf.get_text(spos, epos, false);\n\t\t\tprint(\"got string\\n%s\\n\", str);\n\t\t\n\t\t}\n\t}\n    return ;\n}\n\n \n"
+            "changed" : " () => {\n \n\n    // check syntax??\n    // ??needed..??\n   // _this.save_button.el.sensitive = true;\n    ///?? has changed occured during loading?\n    \n    // only trigger this if \n    \n    \n    \n    \n    if (_this.sourceview.loading) {\n\t\treturn;\n\t}\n\t\n\n\t\n    print(\"- PREVIEW EDITOR CHANGED--\");\n\n    this.dirty = true;  \n    this.checkSyntax(); // this calls backs and highlights errors.. in theory...  \n\n\n\n\tif (!_this.sourceview.button_is_pressed && !_this.sourceview.key_is_pressed) {\n\t\tprint(\"button or key not pressed to generate change?!\\n\");\n\t\treturn;\n\t}\n\t\t\n    \n\t// what are we editing??\n\tif (null == _this.sourceview.node_selected || _this.sourceview.prop_selected.length  < 1) {\n\t\treturn;\n\t}\n\t\n\t// find the colon on the first line...\n\t\n\tif (_this.sourceview.editable_start_pos > -1) {\n\t\t\n\t\tvar buf = (Gtk.SourceBuffer)_this.sourceview.el.get_buffer();\n\t\t\n        //print(\"cursor changed : %d\\n\", buf.cursor_position);\n        Gtk.TextIter spos,epos;\n        buf.get_iter_at_offset(out spos, _this.sourceview.editable_start_pos);\n        buf.get_iter_at_offset(out epos, _this.sourceview.editable_start_pos); // initialize epos..\n        \n        var gotit= false;\n        var line = spos.get_line();\n        var endline = buf.get_line_count();\n        while (line < endline) {\n    \t\tline++;\n\t        buf.get_iter_at_line(out epos, line);\n\t        if (buf.get_source_marks_at_line(line, \"grey\").length() > 0) {\n\t\t        buf.get_iter_at_line(out epos, line);\t    \t\t\n\t    \t\tgotit=true;\n\t    \t\tbreak;\n    \t\t}\n\t\t}\n        \n \t\tif (gotit) {\n\t \t\tprint(\"End Offset = %d/%d\\n\", epos.get_line(), epos.get_offset());\n\t\t\t// get the pos...\n\t\t\t// in theory the last char will be '}' or '},' .. or ','\n\t\t\t// we should chop the ',' of the end...\n\t\t\tvar str = buf.get_text(spos, epos, false);\n\t\t\tprint(\"got string\\n%s\\n\", str);\n\t\t\n\t\t}\n\t}\n    return ;\n}\n\n \n"
            },
            "bool dirty" : false,
            "int error_line" : "-1",
index a74eb0d..7fe51d5 100644 (file)
@@ -1560,7 +1560,7 @@ public class Xcls_WindowRooView : Object
                     while (line < endline) {
                                line++;
                        buf.get_iter_at_line(out epos, line);
-                       if (buf.get_source_marks_at_line(line, "grey")) {
+                       if (buf.get_source_marks_at_line(line, "grey").length() > 0) {
                                buf.get_iter_at_line(out epos, line);                   
                                gotit=true;
                                break;