X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FBuilder4%2FWindowRooView.vala;h=5996176cf0736c8ba40e0f36d5778fecf5372f85;hb=497a66cfff975b566b929d3496d160ac6321fe02;hp=e60cfc9cb5a76e9bc37860ea42f1c9c00fa6b43e;hpb=2ffd87e8def982caaad4446a194d848df8e6762f;p=app.Builder.js diff --git a/src/Builder4/WindowRooView.vala b/src/Builder4/WindowRooView.vala index e60cfc9cb..5996176cf 100644 --- a/src/Builder4/WindowRooView.vala +++ b/src/Builder4/WindowRooView.vala @@ -1031,6 +1031,10 @@ public class Xcls_WindowRooView : Object return false; }); + this.el.key_press_event.connect( () => { + this.onCursorChanged(); + return false; + }); } // user defined functions @@ -1131,6 +1135,9 @@ public class Xcls_WindowRooView : Object this.node_selected = sel; this.updateGreySelection(scroll); + + + } public string toString () { Gtk.TextIter s; @@ -1186,14 +1193,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; }); @@ -1269,7 +1280,7 @@ public class Xcls_WindowRooView : Object var first_line = this.el.buffer.get_text(start_line_iter, end_line_iter, false); print("first line = %s\n", first_line); if (first_line.contains(":")) { - colon_pos = start_line_iter.get_offset() + first_line.index_of(":"); + colon_pos = start_line_iter.get_offset() + first_line.index_of(":") + 1; } print("colon_pos = %d\n", colon_pos); } @@ -1455,13 +1466,14 @@ public class Xcls_WindowRooView : Object - return this.highlightErrors(p.validateJavascript( + return p.javascriptHasErrors( + _this.main_window.windowstate, str, "", // _this.key, "file", //_this.ptype, _this.file, null - )); + ); } }