X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=blobdiff_plain;f=src%2FBuilder4%2FWindowRooView.vala;h=f50a17d22067ee34f7658018a7ad33aa475153c5;hp=c53d05ea26ee74de734edad1ffe0e26616af8fec;hb=6dc1ae1309010b75d9ce02f114d9784d36d2747c;hpb=cc52aac6aa4b594a82fd50646ccab3b4a8d85965 diff --git a/src/Builder4/WindowRooView.vala b/src/Builder4/WindowRooView.vala index c53d05ea2..f50a17d22 100644 --- a/src/Builder4/WindowRooView.vala +++ b/src/Builder4/WindowRooView.vala @@ -1190,14 +1190,18 @@ public class Xcls_WindowRooView : Object sbuf.remove_source_marks (start, end, null); // remove all marks.. GLib.Timeout.add(500, () => { - - print("RESORTING cursor to = %d\n", cpos); + + print("RESORTING cursor to = %d\n", cpos); Gtk.TextIter cpos_iter; buf.get_iter_at_offset(out cpos_iter, cpos); buf.place_cursor(cpos_iter); this.el.get_vadjustment().set_value(vadj_pos);; + + this.onCursorChanged(); + + _this.buffer.checkSyntax(); return false; }); @@ -1335,64 +1339,8 @@ public class Xcls_WindowRooView : Object } public void highlightErrorsJson (string type, Json.Object obj) { - Gtk.TextIter start; - Gtk.TextIter end; - - var buf = this.el.get_buffer(); - var sbuf = (Gtk.SourceBuffer)buf; - buf.get_bounds (out start, out end); - - sbuf.remove_source_marks (start, end, type); - - - // we should highlight other types of errors.. - - if (!obj.has_member(type)) { - print("Return has no errors\n"); - return ; - } - var err = obj.get_object_member(type); - - if (_this.file == null) { - return; // just in case the file has not loaded yet? - } - - - print("checking for errors in " + _this.file.path); - - if (!err.has_member(_this.file.path)) { - print("File path has no errors\n"); - return ; - } - var lines = err.get_object_member(_this.file.path); - - - - var tlines = buf.get_line_count () +1; - - lines.foreach_member((obj, line, node) => { - - Gtk.TextIter iter; - // print("get inter\n"); - var eline = int.parse(line) -1 ; - print("GOT ERROR on line %s -- converted to %d\n", line,eline); - - - if (eline > tlines || eline < 0) { - return; - } - sbuf.get_iter_at_line( out iter, eline); - //print("mark line\n"); - var msg = type + " on line: %d ".printf(eline+1 ); - var ar = lines.get_array_member(line); - for (var i = 0 ; i < ar.get_length(); i++) { - msg += (msg.length > 0) ? "\n" : ""; - msg += ar.get_string_element(i); - } - - - sbuf.create_source_mark(msg, type, iter); - } ); + // this is a hook for the vala code - it has no value in javascript + // as we only have one error ususally.... return ; @@ -1514,14 +1462,13 @@ public class Xcls_WindowRooView : Object } - + return p.javascriptHasErrors( _this.main_window.windowstate, str, "", // _this.key, "file", //_this.ptype, _this.file, - null, null );