2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Gtk.Widget lastObj" : "null",
7 "# GtkSource.SearchContext searchcontext" : "",
8 "# JsRender.JsRender file" : "null",
9 "# Xcls_MainWindow main_window" : "",
14 "\tthis.css = new Gtk.CssProvider();",
16 "\tthis.css.load_from_string(",
17 "\t\t\"#gtkview-view-layout { background-color: #ccc; }\"",
20 "\tGtk.StyleContext.add_provider_for_display(",
21 "\t\tthis.el.get_display(),",
23 "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
30 "Gtk.CssProvider css" : "",
31 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
32 "bool hexpand" : true,
33 "bool vexpand" : true,
35 "int last_error_counter" : 0,
36 "int last_search_end" : 0,
40 "Gtk.Overflow overflow" : "Gtk.Overflow.VISIBLE",
46 "id" : "label_preview",
47 "utf8 label" : "Preview",
54 "utf8 label" : "Preview Generated Code",
59 "* pack" : "append_page,_this.label_preview.el",
63 "* pack" : "set_child",
68 "* pack" : "put,10,10",
69 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
74 "string name" : "gtkview-view-layout",
78 "xtype" : "ScrolledWindow"
82 "* pack" : "append_page,_this.label_code.el",
83 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
88 "bool vexpand" : true,
89 "id" : "sourceviewscroll",
92 "# JsRender.Node? node_selected" : "",
93 "# string prop_selected" : "\"\"",
94 "$ xns" : "GtkSource",
99 "\tthis.css = new Gtk.CssProvider();",
101 "\tthis.css.load_from_string(\"#gtkview-view { font: 10px monospace ;}\");",
103 "\tGtk.StyleContext.add_provider_for_display(",
104 "\t\tthis.el.get_display(),",
106 "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
110 "\tthis.loading = true;",
114 "\tvar attrs = new GtkSource.MarkAttributes();",
115 "\t attrs.set_icon_name ( \"process-stop\"); ",
116 "\tattrs.query_tooltip_text.connect(( mark) => {",
117 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
118 "\t\treturn mark.name;",
121 "\tthis.el.set_mark_attributes (\"ERR\", attrs, 1);",
123 "\t var wattrs = new GtkSource.MarkAttributes();",
124 "\t wattrs.set_icon_name ( \"process-stop\"); ",
125 "\twattrs.query_tooltip_text.connect(( mark) => {",
126 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
127 "\t\treturn mark.name;",
130 "\tthis.el.set_mark_attributes (\"WARN\", wattrs, 1);",
134 "\t var dattrs = new GtkSource.MarkAttributes();",
135 "\tdattrs.set_icon_name ( \"process-stop\"); ",
136 "\tdattrs.query_tooltip_text.connect(( mark) => {",
137 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
138 "\t\treturn mark.name;",
141 "\tthis.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
144 "\tvar gattrs = new GtkSource.MarkAttributes();",
145 "\tvar grey = Gdk.RGBA();",
146 "\tgrey.parse ( \"#ccc\");",
147 "\tgattrs.set_background ( grey);",
150 "\tthis.el.set_mark_attributes (\"grey\", gattrs, 1);",
160 "* pack" : "set_child",
161 "Gtk.CssProvider css" : "",
162 "bool loading" : false,
163 "bool zallow_node_scroll" : true,
164 "gboolean editable" : false,
165 "gboolean show_line_marks" : true,
166 "gboolean show_line_numbers" : true,
170 "$ xns" : "GtkSource",
173 "var buf = this.el;",
174 "buf.create_tag (\"bold\", \"weight\", Pango.Weight.BOLD);",
175 "buf.create_tag (\"type\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#204a87\");",
176 "buf.create_tag (\"keyword\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#a40000\");",
177 "buf.create_tag (\"text\", \"weight\", Pango.Weight.NORMAL, \"foreground\", \"#729fcf\");",
178 "buf.create_tag (\"number\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#ad7fa8\");",
179 "buf.create_tag (\"method\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#729fcf\");",
180 "buf.create_tag (\"property\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#BC1F51\");",
181 "buf.create_tag (\"variable\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#A518B5\");",
184 "buf.create_tag (\"ERR\", \"weight\", Pango.Weight.BOLD, \"background\", \"pink\");",
185 "buf.create_tag (\"WARN\", \"weight\", Pango.Weight.BOLD, \"background\", \"#ABF4EB\");",
186 "buf.create_tag (\"DEPR\", \"weight\", Pango.Weight.BOLD, \"background\", \"#EEA9FF\");",
191 "* pack" : "set_buffer",
192 "bool dirty" : false,
193 "bool in_cursor_change" : false,
195 "int error_line" : "-1",
196 "int last_line" : "-1",
200 "GLib.debug(\"cursor moved called\");",
203 " \tif (this.in_cursor_change ) {",
204 " GLib.debug(\"cursor changed : %d [ignoring nested call)\", this.el.cursor_position);",
208 " GLib.debug(\"cursor changed : %d\", this.el.cursor_position);",
209 " Gtk.TextIter cpos;",
210 " this.el.get_iter_at_offset(out cpos, this.el.cursor_position);",
212 " var ln = cpos.get_line();",
213 " if (this.last_line == ln ){",
216 "\tthis.last_line = ln;",
217 " var node = _this.file.lineToNode(ln);",
219 " if (node == null) {",
220 " print(\"can not find node\\n\");",
223 " this.in_cursor_change = true;",
224 " var ltree = _this.main_window.windowstate.left_tree;",
225 " ltree.model.selectNode(node);",
226 " this.in_cursor_change = false;",
237 "(keyval, keycode, state) => {",
241 "\t if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
242 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
243 "\t\t_this.forwardSearch(true);",
246 " if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
247 "\t GLib.debug(\"SAVE: ctrl-f pressed\");",
248 "\t\t_this.search_entry.el.grab_focus();",
257 "xtype" : "EventControllerKey"
262 "(x, y, keyboard_tooltip, tooltip) => {",
264 "\t//GLib.debug(\"query tooltip\");",
265 "\tGtk.TextIter iter;",
268 "\tvar yoff = (int) _this.sourceviewscroll.el.vadjustment.value;",
270 "\tthis.el.get_iter_at_position (out iter, out trailing, x, y + yoff);",
272 "\tvar l = iter.get_line();",
273 "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
274 "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
275 "\tif (marks.is_empty()) {",
276 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
278 "\tif (marks.is_empty()) {",
279 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
282 "\t// GLib.debug(\"query tooltip line marks %d\", (int) marks.length());",
284 "\tmarks.@foreach((m) => { ",
285 "\t\t//GLib.debug(\"got mark %s\", m.name);",
286 "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.name;",
289 "\t// true if there is a mark..",
290 "\ttooltip.set_text( str);",
291 "\treturn str.length > 0 ? true : false;",
297 "string name" : "gtkview-view",
298 "uint tab_width" : 4,
300 "| string toString" : [
304 " this.el.get_buffer().get_start_iter(out s);",
305 " this.el.get_buffer().get_end_iter(out e);",
306 " var ret = this.el.get_buffer().get_text(s,e,true);",
307 " //print(\"TO STRING? \" + ret);",
312 "| void loadFile" : [
314 " this.loading = true;",
315 " var buf = this.el.get_buffer();",
316 " buf.set_text(\"\",0);",
317 " var sbuf = (GtkSource.Buffer) buf;",
318 "\tvar cpos = buf.cursor_position;",
320 " \tprint(\"BEFORE LOAD cursor = %d\\n\", cpos);",
321 " var vadj_pos = this.el.get_vadjustment().get_value();",
323 " if (_this.file == null || _this.file.xtype != \"Gtk\") {",
324 " print(\"xtype != Gtk\");",
325 " this.loading = false;",
329 " var valafn = \"\";",
331 " var regex = new Regex(\"\\\\.bjs$\");",
334 " valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
335 " } catch (GLib.RegexError e) {",
336 " this.loading = false;",
341 " if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {",
342 " print(\"File path has no errors\\n\");",
343 " this.loading = false;",
350 " GLib.FileUtils.get_contents (valafn, out str);",
351 " } catch (Error e) {",
352 " this.loading = false;",
356 " var str = _this.file.toSource();",
358 "// print(\"setting str %d\\n\", str.length);",
359 " buf.set_text(str, str.length);",
360 " var lm = GtkSource.LanguageManager.get_default();",
362 " //?? is javascript going to work as js?",
364 " ((GtkSource.Buffer)(buf)) .set_language(lm.get_language(_this.file.language));",
367 " _this.main_window.windowstate.updateErrorMarksAll(); ",
368 " // restore the cursor position?",
369 " // after reloading the contents.",
370 " GLib.Timeout.add(500, () => {",
371 "\t\t_this.buffer.in_cursor_change = true;",
372 " print(\"RESORTING cursor to = %d\\n\", cpos);",
373 "\t\tGtk.TextIter cpos_iter;",
374 "\t\tbuf.get_iter_at_offset(out cpos_iter, cpos);",
375 "\t\tbuf.place_cursor(cpos_iter); ",
377 "\t\tthis.el.get_vadjustment().set_value(vadj_pos);;",
378 "\t\t_this.buffer.in_cursor_change = false;",
382 "\t\t//_this.buffer.checkSyntax();",
387 " this.loading = false; ",
391 "| void nodeSelected" : [
392 "(JsRender.Node? sel, bool scroll) {",
395 " if (this.loading) {",
398 " // this is connected in widnowstate",
399 " print(\"Roo-view - node selected\\n\");",
400 " var buf = this.el.get_buffer();",
402 " var sbuf = (GtkSource.Buffer) buf;",
408 " // clear all the marks..",
409 " Gtk.TextIter start;",
410 " Gtk.TextIter end; ",
412 " sbuf.get_bounds (out start, out end);",
413 " sbuf.remove_source_marks (start, end, \"grey\");",
415 " this.node_selected = sel;",
416 " if (sel == null) {",
417 " // no highlighting..",
420 " Gtk.TextIter iter; ",
421 " sbuf.get_iter_at_line(out iter, sel.line_start);",
424 " Gtk.TextIter cur_iter;",
425 " sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);",
428 " if (!_this.buffer.in_cursor_change) {",
430 " \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
435 " for (var i = 0; i < buf.get_line_count();i++) {",
436 " if (i < sel.line_start || i > sel.line_end) {",
438 " sbuf.get_iter_at_line(out iter, i);",
439 " sbuf.create_source_mark(null, \"grey\", iter);",
451 "xtype" : "ScrolledWindow"
455 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
456 "bool homogeneous" : false,
457 "bool vexpand" : false,
464 "this.css = new Gtk.CssProvider();",
466 "this.css.load_from_string(\"",
467 "\t#gtkview-search-entry { font: 10px monospace ;}\"",
470 "Gtk.StyleContext.add_provider_for_display(",
471 "\tthis.el.get_display(),",
473 "\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
479 "Gtk.CssProvider css" : "",
480 "bool hexpand" : true,
481 "id" : "search_entry",
487 "(keyval, keycode, state) => {",
489 "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
490 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
491 "\t\t_this.forwardSearch(true);",
496 " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
497 "\t\t_this.forwardSearch(true);",
503 " // print(event.key.keyval)",
510 "xtype" : "EventControllerKey"
517 "\t_this.search(_this.search_entry.el.text);",
518 "\t _this.search_results.updateResults();",
520 "\tGLib.Timeout.add_seconds(1,() => {",
521 "\t\t _this.search_results.updateResults();",
522 "\t\t return false;",
530 "string name" : "gtkview-search-entry",
531 "string placeholder_text" : "Press enter to search",
532 "uint search_delay" : 3,
533 "xtype" : "SearchEntry",
534 "| void forwardSearch" : [
535 "(bool change_focus) {",
538 "\t_this.forwardSearch(change_focus);",
542 "\tswitch(_this.windowstate.state) {",
543 "\t\tcase WindowState.State.CODEONLY:",
544 "\t\t//case WindowState.State.CODE:",
545 "\t\t\t// search the code being edited..",
546 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
549 "\t\tcase WindowState.State.PREVIEW:",
550 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
551 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
553 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
566 "id" : "search_results",
567 "int margin_end" : 4,
568 "int margin_start" : 4,
569 "string label" : "No Results",
571 "| void updateResults" : [
573 "\tthis.el.visible = true;",
575 "\tvar res = _this.searchcontext.get_occurrences_count();",
577 "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
581 "\t_this.nextBtn.el.sensitive = false;",
582 "\t_this.backBtn.el.sensitive = false;\t",
585 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
586 "\t\t_this.nextBtn.el.sensitive = true;",
587 "\t\t_this.backBtn.el.sensitive = true;",
590 "\t_this.search_results.el.label = \"No Matches\";",
597 "bool always_show_image" : true,
598 "bool sensitive" : false,
603 "_this.forwardSearch(true);",
610 "string icon_name" : "go-down",
615 "bool always_show_image" : true,
616 "bool sensitive" : false,
622 "_this.backSearch(true);",
628 "string icon_name" : "go-up",
633 "bool always_show_arrow" : true,
634 "bool always_show_image" : true,
638 "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
639 "* prop" : "popover",
640 "id" : "search_settings",
644 "* pack" : "set_child",
645 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
650 "id" : "case_sensitive",
651 "string label" : "Case Sensitive",
652 "xtype" : "CheckButton"
657 "string label" : "Regex",
658 "xtype" : "CheckButton"
663 "string label" : "Multi-line (add \\n)",
664 "xtype" : "CheckButton"
670 "xtype" : "PopoverMenu"
673 "string icon_name" : "emblem-system",
674 "xtype" : "MenuButton"
689 "\tthis.notebook.el.page = 1;",
693 "\tvar s = new GtkSource.SearchSettings();",
694 "\ts.case_sensitive = _this.case_sensitive.el.active;",
695 "\ts.regex_enabled = _this.regex.el.active;\t",
696 "\ts.wrap_around = false;",
698 "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
699 "\tthis.searchcontext.set_highlight(true);",
700 "\tvar txt = in_txt;",
702 "\tif (_this.multiline.el.active) {",
703 "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
706 "\ts.set_search_text(txt);",
707 "\tGtk.TextIter beg, st,en;",
708 "\tbool has_wrapped_around;",
709 "\tthis.buffer.el.get_start_iter(out beg);",
710 "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
711 "\tthis.last_search_end = 0;",
713 "\treturn this.searchcontext.get_occurrences_count();",
721 "| void backSearch" : [
722 "(bool change_focus) {",
724 "\tif (this.searchcontext == null) {",
728 "\tGtk.TextIter beg, st,en;",
729 "\tbool has_wrapped_around;",
730 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
732 "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
734 "\t\tthis.last_search_end = 0;",
737 "\tthis.last_search_end = en.get_offset();",
738 "\tif (change_focus) {",
739 "\t\tthis.sourceview.el.grab_focus();",
741 "\tthis.buffer.el.place_cursor(st);",
742 "\tthis.sourceview.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
743 "\tvar ln = st.get_line();",
744 "\tthis.highlightNodeAtLine(ln);",
749 "| void createThumb" : [
753 " if (this.file == null) {",
756 " // only screenshot the gtk preview..",
757 " if (this.notebook.el.page > 0 ) {",
762 " \tthis.file.widgetToIcon(this.container.el); ",
771 " // should we hold until it's printed...",
779 "| void forwardSearch" : [
780 "(bool change_focus) {",
782 "\tif (this.searchcontext == null) {",
785 "\tthis.notebook.el.page = 1;",
786 "\tGtk.TextIter beg, st,en;",
787 "\tbool has_wrapped_around;",
788 "\tvar buf = this.sourceview.el.get_buffer();",
789 "\tbuf.get_iter_at_offset(out beg, this.last_search_end);",
790 "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
791 "\t\tthis.last_search_end = 0;",
794 "\tthis.last_search_end = en.get_offset();",
795 "\tif (change_focus) {",
796 "\t\tthis.sourceview.el.grab_focus();",
798 "\tbuf.place_cursor(st);",
802 "\tthis.sourceview.el.scroll_to_iter(st, 0.0f, true, 0.0f, 0.5f);",
805 "\tvar ln = st.get_line();",
807 "\tthis.highlightNodeAtLine(ln);",
811 "| void highlightNodeAtLine" : [
814 "\t// this is done from clicking on the editor..",
816 "\t// highlight node...",
819 " var node = _this.file.lineToNode(ln+1);",
821 " if (node == null) {",
822 " //print(\"can not find node\\n\");",
825 " var prop = node.lineToProp(ln+1);",
826 " print(\"prop : %s\", prop == null ? \"???\" : prop.name);",
829 " // ---------- this selects the tree's node...",
831 " var ltree = _this.main_window.windowstate.left_tree;",
832 " ltree.model.selectNode(node);",
833 " //var tp = ltree.model.treePathFromNode(node);",
835 " //print(\"got tree path %s\\n\", tp);",
836 " //if (tp == \"\") {",
839 " //_this.sourceview.allow_node_scroll = false; /// block node scrolling..",
842 " //print(\"changing cursor on tree..\\n\");",
846 " // let's try allowing editing on the methods.",
847 " // a little klunky at present..",
848 "\t_this.sourceview.prop_selected = \"\";",
850 " if (prop != null) {",
851 "\t\t//see if we can find it..",
852 "\t\tvar kv = prop.split(\":\");",
853 "\t\tif (kv[0] == \"p\") {",
855 " \t\t//var k = prop.get_key(kv[1]);",
856 " \t\t// fixme -- need to determine if it's an editable property...",
857 " \t\t_this.sourceview.prop_selected = prop;",
859 "\t\t} else if (kv[0] == \"l\") {",
860 "\t\t\t _this.sourceview.prop_selected = prop;",
865 " //ltree.view.setCursor(tp, \"editor\");",
866 " // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); ",
867 " _this.sourceview.nodeSelected(node,false);",
869 " // scrolling is disabled... as node selection calls scroll 10ms after it changes.",
870 " // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
871 "\t // this.allow_node_scroll = true;",
872 "\t // return false;",
889 "| void loadFile" : [
890 "(JsRender.JsRender file) ",
892 " this.file = null;",
894 " if (file.tree == null) {",
897 " this.last_error_counter = -1;",
898 " this.notebook.el.page = 0;// gtk preview ",
902 " this.file = file; ",
903 " this.sourceview.loadFile();",
905 " this.searchcontext = null;",
906 " this.last_error_counter = -1;",
907 "\t\tthis.updateErrorMarks();",
908 " if (this.lastObj != null) {",
909 " this.container.el.remove(this.lastObj);",
912 " // hide the compile view at present..",
915 " var w = this.el.get_width();",
916 " var h = this.el.get_height();",
918 " print(\"ALLOC SET SIZES %d, %d\\n\", w,h); ",
920 " // set the container size min to 500/500 or 20 px less than max..",
921 " w = int.max (w-20, 500);",
922 " h = int.max (h-20, 500); ",
924 " print(\"SET SIZES %d, %d\\n\", w,h); ",
925 " _this.container.el.set_size_request(w,h);",
927 " _this.view_layout.el.set_size_request(w,h); ",
928 " // should be baded on calc.. -- see update_scrolled.",
930 " var fc = this.container.el.get_first_child();",
931 " if (fc != null) {",
932 " \t\tthis.container.el.remove(fc);",
935 " \t\tvar xmlstr = JsRender.NodeToGlade.mungeFile( file);",
936 " \t\tvar builder = new Gtk.Builder.from_string (xmlstr, xmlstr.length);",
937 " \t\tvar obj = (Gtk.Widget) builder.get_object(\"w\"+ file.tree.oid.to_string());",
938 " \t\t this.container.el.append(obj);",
940 " this.createThumb();",
948 "| void scroll_to_line" : [
950 " // code preview...",
952 " GLib.Timeout.add(100, () => {",
955 "\t this.notebook.el.set_current_page(1);",
957 "\t\t var buf = this.sourceview.el.get_buffer();",
959 "\t\tvar sbuf = (GtkSource.Buffer) buf;",
962 "\t\tGtk.TextIter iter; ",
963 "\t\tsbuf.get_iter_at_line(out iter, line);",
964 "\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
972 "| void updateErrorMarks" : [
977 "\tvar buf = _this.buffer.el;",
978 "\tGtk.TextIter start;",
979 "\tGtk.TextIter end; ",
980 "\tbuf.get_bounds (out start, out end);",
984 "\tGLib.debug(\"highlight errors\");\t\t ",
986 "\t // we should highlight other types of errors..",
991 "\tif (_this.file == null) {",
992 "\t\tGLib.debug(\"file is null?\");",
996 "\tvar ar = this.file.getErrors();",
997 "\tif (ar.size < 1) {",
998 "\t\tbuf.remove_tag_by_name (\"ERR\", start, end);",
999 "\t\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1000 "\t\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1001 "\t\tbuf.remove_source_marks (start, end, null);",
1002 "\t\tthis.last_error_counter = file.error_counter ;",
1003 "\t\tGLib.debug(\"higjlight has no errors\");",
1006 " \tif (this.last_error_counter == file.error_counter) {",
1014 "\tvar tlines = buf.get_line_count () +1;",
1018 "\tbuf.remove_source_marks (start, end, null);",
1019 "\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1020 "\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1021 "\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1022 "\tforeach(var diag in ar) { ",
1025 "\t Gtk.TextIter iter;",
1026 "// print(\"get inter\\n\");",
1027 "\t var eline = (int)diag.range.start.line ;",
1028 "\t var eline_to = (int)diag.range.end.line;",
1029 "\t if (eline > tlines || eline < 0) {",
1034 "\t buf.get_iter_at_line( out iter, eline);",
1036 "\t \t buf.get_iter_at_line_offset( out start, ",
1037 " \t \teline, (int)diag.range.start.character); ",
1038 " \t buf.get_iter_at_line_offset( out end, ",
1039 " \t \teline_to, (int)diag.range.end.character); ",
1041 "\t buf.apply_tag_by_name(diag.category, start, end);",
1044 "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
1045 "\t buf.create_source_mark( msg, diag.category, iter);",
1046 "\t GLib.debug(\"set line %d to %s\", eline, msg);",
1047 "\t //this.marks.set(eline, msg);",
1049 "\tthis.last_error_counter = file.error_counter ;",