"bool hexpand" : true,
"bool vexpand" : true,
"id" : "GtkView",
+ "int last_error_counter" : 0,
"int last_search_end" : 0,
"items" : [
{
" if (file.tree == null) {",
" return;",
" }",
+ " this.last_error_counter = -1;",
" this.notebook.el.page = 0;// gtk preview ",
" ",
" ",
" ",
" this.file = file; ",
" this.sourceview.loadFile();",
+ " ",
" this.searchcontext = null;",
- " ",
- "",
+ " this.last_error_counter = -1;",
+ "\t\tthis.updateErrorMarks();",
" if (this.lastObj != null) {",
" this.container.el.remove(this.lastObj);",
" }",
" this.createThumb();",
" ",
" \t ",
- " return;/*",
- "\tvar x = new JsRender.NodeToGtk((Project.Gtk) file.project, file.tree);",
- " var obj = x.munge() as Gtk.Widget;",
- " this.lastObj = null;",
- "\tif (obj == null) {",
- " \treturn;",
- "\t}",
- "\tthis.lastObj = obj;",
- " ",
- " this.container.el.append(obj);",
- " obj.show();",
- " ",
- " */",
+ " ",
" ",
"}",
" "
""
],
"| void updateErrorMarks" : [
- "(string category) {",
+ "() {",
"\t",
" ",
"",
"\tGtk.TextIter end; ",
"\tbuf.get_bounds (out start, out end);",
"",
- "\tbuf.remove_source_marks (start, end, category);",
+ "",
" ",
"\tGLib.debug(\"highlight errors\");\t\t ",
"",
"\t\treturn;",
"",
"\t}",
- "\tvar ar = this.file.getErrors(category);",
- "\tif (ar == null || ar.get_n_items() < 1) {",
- "\t\tGLib.debug(\"higjlight %s has no errors\", category);",
+ "\tvar ar = this.file.getErrors();",
+ "\tif (ar.size < 1) {",
+ "\t\tbuf.remove_source_marks (start, end, null);",
+ "\t\tthis.last_error_counter = file.error_counter ;",
+ "\t\tGLib.debug(\"higjlight has no errors\");",
"\t\treturn;",
"\t}",
- " ",
+ " \tif (this.last_error_counter == file.error_counter) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
"",
" ",
"\t ",
"\t",
" ",
"\t ",
- "\tfor (var i = 0; i < ar.get_n_items();i++) {",
- "\t\tvar err = (Palete.CompileError) ar.get_item(i);",
+ "\tbuf.remove_source_marks (start, end, null);",
+ "\tforeach(var diag in ar) { ",
+ "\t",
"\t\t",
"\t Gtk.TextIter iter;",
"// print(\"get inter\\n\");",
- "\t var eline = err.line + 1;",
- "\t GLib.debug(\"GOT ERROR on line %d -- converted to %d \",",
- "\t \terr.line ,eline);",
- "\t ",
+ "\t var eline = (int)diag.range.start.line ;",
"\t ",
"\t if (eline > tlines || eline < 0) {",
"\t return;",
"\t buf.get_iter_at_line( out iter, eline);",
"\t ",
"\t ",
- "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, err.category, err.msg);",
- "\t buf.create_source_mark( msg, err.category, iter);",
+ "\t ",
+ "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
+ "\t buf.create_source_mark( msg, diag.category, iter);",
"\t GLib.debug(\"set line %d to %s\", eline, msg);",
"\t //this.marks.set(eline, msg);",
"\t}",
- "\treturn ;",
+ "\tthis.last_error_counter = file.error_counter ;",
"",
"",
"",