Gtk.TextIter cur_iter;
sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);
+
+ var cursor_at_line = cur_iter.get_line();
+
//var cur_line = cur_iter.get_line();
//if (cur_line > sel.line_start && cur_line < sel.line_end) {
this.el.editable = false;
+
+ var before_cursor_string = "";
+
// now if we have selected a property...
if (this.propSelected.length> 0 ) {
start_line = nstart;
end_line = nend;
this.el.editable = true;
+
+
+ // see if we are 'right of ':'
+ // get an iter for the start of the line.
+ Gtk.TextIter start_line_iter, end_start_line_iter;
+ this.el.buffer.get_iter_at_line(out start_line_iter, start_line);
+ this.el.buffer.get_iter_at_line(out end_start_line_iter, start_line+1);
+ if (start_line == cursor_at_line) {
+ var before_cursor_string = this.el.buffer.get_text(start_line_iter, cur_iter, false);
+ if (!before_cursor_string.contains(":")) {
+ this.el.editable = false;
+ }
+
+ }
+
+
}
print("propSelected = %s range %d -> %d\n", this.propSelected, start_line, end_line);
}
+
+
+
// check selection - if it's out of 'bounds'
if (this.el.editable && sbuf.get_has_selection()) {
Gtk.TextIter sel_start_iter, sel_end_iter;
print("- PREVIEW EDITOR CHANGED--");
+ this.dirty = true;
+ if (!this.checkSyntax()) {
+ return;
+ }
- this.checkSyntax();
+ // what are we editing??
- this.dirty = true;
+
+
return ;
if (_this.file.language != "js") {
- return false; // no syntax.
+ return false; // fake syntax error.
}