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" : "",
10 "# int last_error_counter" : 0,
11 "# int last_search_end" : 0,
13 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
14 "bool hexpand" : true,
15 "bool vexpand" : true,
20 "Gtk.Overflow overflow" : "Gtk.Overflow.VISIBLE",
26 "id" : "label_preview",
27 "utf8 label" : "Preview",
34 "utf8 label" : "Preview Generated Code",
39 "* pack" : "append_page,_this.label_preview.el",
43 "* pack" : "set_child",
48 "* pack" : "put,10,10",
49 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
54 "string name" : "gtkview-view-layout",
58 "xtype" : "ScrolledWindow"
62 "* pack" : "append_page,_this.label_code.el",
63 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
68 "bool vexpand" : true,
69 "id" : "sourceviewscroll",
72 "# JsRender.Node? node_selected" : "",
73 "# bool loading" : false,
74 "# string prop_selected" : "\"\"",
75 "$ xns" : "GtkSource",
80 "\tthis.loading = true;",
83 "\tvar attrs = new GtkSource.MarkAttributes();",
84 "\t attrs.set_icon_name ( \"process-stop\"); ",
85 "\tattrs.query_tooltip_text.connect(( mark) => {",
86 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
87 "\t\treturn mark.name;",
90 "\tthis.el.set_mark_attributes (\"ERR\", attrs, 1);",
92 "\t var wattrs = new GtkSource.MarkAttributes();",
93 "\t wattrs.set_icon_name ( \"process-stop\"); ",
94 "\twattrs.query_tooltip_text.connect(( mark) => {",
95 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
96 "\t\treturn mark.name;",
99 "\tthis.el.set_mark_attributes (\"WARN\", wattrs, 1);",
103 "\t var dattrs = new GtkSource.MarkAttributes();",
104 "\tdattrs.set_icon_name ( \"process-stop\"); ",
105 "\tdattrs.query_tooltip_text.connect(( mark) => {",
106 "\t\t//print(\"tooltip query? %s\\n\", mark.name);",
107 "\t\treturn mark.name;",
110 "\tthis.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
113 "\tvar gattrs = new GtkSource.MarkAttributes();",
114 "\tvar grey = Gdk.RGBA();",
115 "\tgrey.parse ( \"#ccc\");",
116 "\tgattrs.set_background ( grey);",
119 "\tthis.el.set_mark_attributes (\"grey\", gattrs, 1);",
129 "* pack" : "set_child",
130 "css_classes" : "{ \"code-editor\" }",
131 "gboolean editable" : false,
132 "gboolean show_line_marks" : true,
133 "gboolean show_line_numbers" : true,
137 "$ xns" : "GtkSource",
140 "var buf = this.el;",
141 "buf.create_tag (\"bold\", \"weight\", Pango.Weight.BOLD);",
142 "buf.create_tag (\"type\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#204a87\");",
143 "buf.create_tag (\"keyword\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#a40000\");",
144 "buf.create_tag (\"text\", \"weight\", Pango.Weight.NORMAL, \"foreground\", \"#729fcf\");",
145 "buf.create_tag (\"number\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#ad7fa8\");",
146 "buf.create_tag (\"method\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#729fcf\");",
147 "buf.create_tag (\"property\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#BC1F51\");",
148 "buf.create_tag (\"variable\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#A518B5\");",
151 "buf.create_tag (\"ERR\", \"weight\", Pango.Weight.BOLD, \"background\", \"pink\");",
152 "buf.create_tag (\"WARN\", \"weight\", Pango.Weight.BOLD, \"background\", \"#ABF4EB\");",
153 "buf.create_tag (\"DEPR\", \"weight\", Pango.Weight.BOLD, \"background\", \"#EEA9FF\");",
158 "* pack" : "set_buffer",
159 "bool dirty" : false,
160 "bool in_cursor_change" : false,
162 "int error_line" : "-1",
163 "int last_line" : "-1",
167 "GLib.debug(\"cursor moved called\");",
170 " \tif (this.in_cursor_change ) {",
171 " GLib.debug(\"cursor changed : %d [ignoring nested call)\", this.el.cursor_position);",
175 " GLib.debug(\"cursor changed : %d\", this.el.cursor_position);",
176 " Gtk.TextIter cpos;",
177 " this.el.get_iter_at_offset(out cpos, this.el.cursor_position);",
179 " var ln = cpos.get_line();",
180 " if (this.last_line == ln ){",
183 "\tthis.last_line = ln;",
184 " var node = _this.file.lineToNode(ln);",
186 " if (node == null) {",
187 " print(\"can not find node\\n\");",
190 " this.in_cursor_change = true;",
191 " var ltree = _this.main_window.windowstate.left_tree;",
192 " ltree.model.selectNode(node);",
193 " this.in_cursor_change = false;",
201 "# bool is_control" : false,
206 "(keyval, keycode, state) => {",
208 "\tif (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
209 " \t\tthis.is_control = true;",
212 "\t if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
213 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
214 "\t\t_this.forwardSearch(true);",
217 " if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
218 "\t GLib.debug(\"SAVE: ctrl-f pressed\");",
219 "\t\t_this.search_entry.el.grab_focus();",
228 "(keyval, keycode, state) => {",
230 "\t if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
231 " \t\tthis.is_control = false;",
237 "xtype" : "EventControllerKey"
240 "# double distance" : "0.0f",
242 "Gtk.EventControllerScrollFlags flags" : "Gtk.EventControllerScrollFlags.VERTICAL",
246 "\tif (!_this.keystate.is_control) {",
249 "\t//GLib.debug(\"scroll %f\", dy);",
251 "\tthis.distance += dy;",
252 "\t if (this.distance < -1) {",
253 "\t\tBuilderApplication.settings.editor_font_size ++;",
254 "\t\tthis.distance = 0;",
256 "\tif (this.distance > 1) {",
257 "\t\tBuilderApplication.settings.editor_font_size --;",
258 "\t\tthis.distance = 0;",
266 "xtype" : "EventControllerScroll"
271 "(x, y, keyboard_tooltip, tooltip) => {",
273 "\t//GLib.debug(\"query tooltip\");",
274 "\tGtk.TextIter iter;",
277 "\tvar yoff = (int) _this.sourceviewscroll.el.vadjustment.value;",
279 "\tthis.el.get_iter_at_position (out iter, out trailing, x, y + yoff);",
281 "\tvar l = iter.get_line();",
282 "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
283 "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
284 "\tif (marks.is_empty()) {",
285 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
287 "\tif (marks.is_empty()) {",
288 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
291 "\t// GLib.debug(\"query tooltip line marks %d\", (int) marks.length());",
293 "\tmarks.@foreach((m) => { ",
294 "\t\t//GLib.debug(\"got mark %s\", m.name);",
295 "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.name;",
298 "\t// true if there is a mark..",
299 "\ttooltip.set_text( str);",
300 "\treturn str.length > 0 ? true : false;",
306 "string name" : "gtkview-view",
307 "uint tab_width" : 4,
309 "| string toString" : [
313 " this.el.get_buffer().get_start_iter(out s);",
314 " this.el.get_buffer().get_end_iter(out e);",
315 " var ret = this.el.get_buffer().get_text(s,e,true);",
316 " //print(\"TO STRING? \" + ret);",
321 "| void loadFile" : [
323 " this.loading = true;",
324 " var buf = this.el.get_buffer();",
325 " buf.set_text(\"\",0);",
327 "\tvar cpos = buf.cursor_position;",
329 " \tprint(\"BEFORE LOAD cursor = %d\\n\", cpos);",
330 " var vadj_pos = this.el.get_vadjustment().get_value();",
332 " if (_this.file == null || _this.file.xtype != \"Gtk\") {",
333 " print(\"xtype != Gtk\");",
334 " this.loading = false;",
338 " var valafn = \"\";",
340 " var regex = new Regex(\"\\\\.bjs$\");",
343 " valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
344 " } catch (GLib.RegexError e) {",
345 " this.loading = false;",
350 " if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {",
351 " print(\"File path has no errors\\n\");",
352 " this.loading = false;",
359 " GLib.FileUtils.get_contents (valafn, out str);",
360 " } catch (Error e) {",
361 " this.loading = false;",
365 " var str = _this.file.toSource();",
367 "// print(\"setting str %d\\n\", str.length);",
368 " buf.set_text(str, str.length);",
369 " var lm = GtkSource.LanguageManager.get_default();",
371 " //?? is javascript going to work as js?",
373 " ((GtkSource.Buffer)(buf)) .set_language(lm.get_language(_this.file.language));",
376 " _this.main_window.windowstate.updateErrorMarksAll(); ",
377 " // restore the cursor position?",
378 " // after reloading the contents.",
379 " GLib.Timeout.add(500, () => {",
380 "\t\t_this.buffer.in_cursor_change = true;",
381 " print(\"RESORTING cursor to = %d\\n\", cpos);",
382 "\t\tGtk.TextIter cpos_iter;",
383 "\t\tbuf.get_iter_at_offset(out cpos_iter, cpos);",
384 "\t\tbuf.place_cursor(cpos_iter); ",
386 "\t\tthis.el.get_vadjustment().set_value(vadj_pos);;",
387 "\t\t_this.buffer.in_cursor_change = false;",
391 "\t\t//_this.buffer.checkSyntax();",
396 " this.loading = false; ",
400 "| void nodeSelected" : [
401 "(JsRender.Node? sel, bool scroll) {",
404 " if (this.loading) {",
407 " // this is connected in widnowstate",
408 " print(\"Roo-view - node selected\\n\");",
409 " var buf = this.el.get_buffer();",
411 " var sbuf = (GtkSource.Buffer) buf;",
417 " // clear all the marks..",
418 " Gtk.TextIter start;",
419 " Gtk.TextIter end; ",
421 " sbuf.get_bounds (out start, out end);",
422 " sbuf.remove_source_marks (start, end, \"grey\");",
424 " this.node_selected = sel;",
425 " if (sel == null) {",
426 " // no highlighting..",
429 " Gtk.TextIter iter; ",
430 " sbuf.get_iter_at_line(out iter, sel.line_start);",
433 " Gtk.TextIter cur_iter;",
434 " sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);",
437 " if (!_this.buffer.in_cursor_change) {",
439 " \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
444 " for (var i = 0; i < buf.get_line_count();i++) {",
445 " if (i < sel.line_start || i > sel.line_end) {",
447 " sbuf.get_iter_at_line(out iter, i);",
448 " sbuf.create_source_mark(null, \"grey\", iter);",
460 "xtype" : "ScrolledWindow"
464 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
465 "bool homogeneous" : false,
466 "bool vexpand" : false,
471 "Gtk.CssProvider css" : "",
472 "bool hexpand" : true,
473 "id" : "search_entry",
479 "(keyval, keycode, state) => {",
481 "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
482 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
483 "\t\t_this.forwardSearch(true);",
488 " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
489 "\t\t_this.forwardSearch(true);",
495 " // print(event.key.keyval)",
502 "xtype" : "EventControllerKey"
509 "\t_this.search(_this.search_entry.el.text);",
510 "\t _this.search_results.updateResults();",
512 "\tGLib.Timeout.add_seconds(1,() => {",
513 "\t\t _this.search_results.updateResults();",
514 "\t\t return false;",
522 "string name" : "gtkview-search-entry",
523 "string placeholder_text" : "Press enter to search",
524 "uint search_delay" : 3,
525 "xtype" : "SearchEntry",
526 "| void forwardSearch" : [
527 "(bool change_focus) {",
530 "\t_this.forwardSearch(change_focus);",
534 "\tswitch(_this.windowstate.state) {",
535 "\t\tcase WindowState.State.CODEONLY:",
536 "\t\t//case WindowState.State.CODE:",
537 "\t\t\t// search the code being edited..",
538 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
541 "\t\tcase WindowState.State.PREVIEW:",
542 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
543 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
545 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
558 "id" : "search_results",
559 "int margin_end" : 4,
560 "int margin_start" : 4,
561 "string label" : "No Results",
563 "| void updateResults" : [
565 "\tthis.el.visible = true;",
567 "\tvar res = _this.searchcontext.get_occurrences_count();",
569 "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
573 "\t_this.nextBtn.el.sensitive = false;",
574 "\t_this.backBtn.el.sensitive = false;\t",
577 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
578 "\t\t_this.nextBtn.el.sensitive = true;",
579 "\t\t_this.backBtn.el.sensitive = true;",
582 "\t_this.search_results.el.label = \"No Matches\";",
589 "bool always_show_image" : true,
590 "bool sensitive" : false,
595 "_this.forwardSearch(true);",
602 "string icon_name" : "go-down",
607 "bool always_show_image" : true,
608 "bool sensitive" : false,
614 "_this.backSearch(true);",
620 "string icon_name" : "go-up",
625 "bool always_show_arrow" : true,
626 "bool always_show_image" : true,
630 "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
631 "* prop" : "popover",
632 "id" : "search_settings",
636 "* pack" : "set_child",
637 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
642 "id" : "case_sensitive",
643 "string label" : "Case Sensitive",
644 "xtype" : "CheckButton"
649 "string label" : "Regex",
650 "xtype" : "CheckButton"
655 "string label" : "Multi-line (add \\n)",
656 "xtype" : "CheckButton"
662 "xtype" : "PopoverMenu"
665 "string icon_name" : "emblem-system",
666 "xtype" : "MenuButton"
681 "\tthis.notebook.el.page = 1;",
685 "\tvar s = new GtkSource.SearchSettings();",
686 "\ts.case_sensitive = _this.case_sensitive.el.active;",
687 "\ts.regex_enabled = _this.regex.el.active;\t",
688 "\ts.wrap_around = false;",
690 "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
691 "\tthis.searchcontext.set_highlight(true);",
692 "\tvar txt = in_txt;",
694 "\tif (_this.multiline.el.active) {",
695 "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
698 "\ts.set_search_text(txt);",
699 "\tGtk.TextIter beg, st,en;",
700 "\tbool has_wrapped_around;",
701 "\tthis.buffer.el.get_start_iter(out beg);",
702 "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
703 "\tthis.last_search_end = 0;",
705 "\treturn this.searchcontext.get_occurrences_count();",
713 "| void backSearch" : [
714 "(bool change_focus) {",
716 "\tif (this.searchcontext == null) {",
720 "\tGtk.TextIter beg, st,en;",
721 "\tbool has_wrapped_around;",
722 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
724 "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
726 "\t\tthis.last_search_end = 0;",
729 "\tthis.last_search_end = en.get_offset();",
730 "\tif (change_focus) {",
731 "\t\tthis.sourceview.el.grab_focus();",
733 "\tthis.buffer.el.place_cursor(st);",
734 "\tthis.sourceview.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
735 "\tvar ln = st.get_line();",
736 "\tthis.highlightNodeAtLine(ln);",
741 "| void createThumb" : [
745 " if (this.file == null) {",
748 " // only screenshot the gtk preview..",
749 " if (this.notebook.el.page > 0 ) {",
754 " \tthis.file.widgetToIcon(this.container.el); ",
763 " // should we hold until it's printed...",
771 "| void forwardSearch" : [
772 "(bool change_focus) {",
774 "\tif (this.searchcontext == null) {",
777 "\tthis.notebook.el.page = 1;",
778 "\tGtk.TextIter beg, st,en;",
779 "\tbool has_wrapped_around;",
780 "\tvar buf = this.sourceview.el.get_buffer();",
781 "\tbuf.get_iter_at_offset(out beg, this.last_search_end);",
782 "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
783 "\t\tthis.last_search_end = 0;",
786 "\tthis.last_search_end = en.get_offset();",
787 "\tif (change_focus) {",
788 "\t\tthis.sourceview.el.grab_focus();",
790 "\tbuf.place_cursor(st);",
794 "\tthis.sourceview.el.scroll_to_iter(st, 0.0f, true, 0.0f, 0.5f);",
797 "\tvar ln = st.get_line();",
799 "\tthis.highlightNodeAtLine(ln);",
803 "| void highlightNodeAtLine" : [
806 "\t// this is done from clicking on the editor..",
808 "\t// highlight node...",
811 " var node = _this.file.lineToNode(ln+1);",
813 " if (node == null) {",
814 " //print(\"can not find node\\n\");",
817 " var prop = node.lineToProp(ln+1);",
818 " print(\"prop : %s\", prop == null ? \"???\" : prop.name);",
821 " // ---------- this selects the tree's node...",
823 " var ltree = _this.main_window.windowstate.left_tree;",
824 " ltree.model.selectNode(node);",
825 " //var tp = ltree.model.treePathFromNode(node);",
827 " //print(\"got tree path %s\\n\", tp);",
828 " //if (tp == \"\") {",
831 " //_this.sourceview.allow_node_scroll = false; /// block node scrolling..",
834 " //print(\"changing cursor on tree..\\n\");",
838 " // let's try allowing editing on the methods.",
839 " // a little klunky at present..",
840 "\t_this.sourceview.prop_selected = \"\";",
842 " if (prop != null) {",
843 "\t\t//see if we can find it..",
844 "\t\tvar kv = prop.split(\":\");",
845 "\t\tif (kv[0] == \"p\") {",
847 " \t\t//var k = prop.get_key(kv[1]);",
848 " \t\t// fixme -- need to determine if it's an editable property...",
849 " \t\t_this.sourceview.prop_selected = prop;",
851 "\t\t} else if (kv[0] == \"l\") {",
852 "\t\t\t _this.sourceview.prop_selected = prop;",
857 " //ltree.view.setCursor(tp, \"editor\");",
858 " // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); ",
859 " _this.sourceview.nodeSelected(node,false);",
861 " // scrolling is disabled... as node selection calls scroll 10ms after it changes.",
862 " // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
863 "\t // this.allow_node_scroll = true;",
864 "\t // return false;",
881 "| void loadFile" : [
882 "(JsRender.JsRender file) ",
884 " this.file = null;",
886 " if (file.tree == null) {",
889 " this.last_error_counter = -1;",
890 " this.notebook.el.page = 0;// gtk preview ",
894 " this.file = file; ",
895 " this.sourceview.loadFile();",
897 " this.searchcontext = null;",
898 " this.last_error_counter = -1;",
899 "\t\tthis.updateErrorMarks();",
900 " if (this.lastObj != null) {",
901 " this.container.el.remove(this.lastObj);",
904 " // hide the compile view at present..",
907 " var w = this.el.get_width();",
908 " var h = this.el.get_height();",
910 " print(\"ALLOC SET SIZES %d, %d\\n\", w,h); ",
912 " // set the container size min to 500/500 or 20 px less than max..",
913 " w = int.max (w-20, 500);",
914 " h = int.max (h-20, 500); ",
916 " print(\"SET SIZES %d, %d\\n\", w,h); ",
917 " _this.container.el.set_size_request(w,h);",
919 " _this.view_layout.el.set_size_request(w,h); ",
920 " // should be baded on calc.. -- see update_scrolled.",
922 " var fc = this.container.el.get_first_child();",
923 " if (fc != null) {",
924 " \t\tthis.container.el.remove(fc);",
927 " \t\tvar xmlstr = JsRender.NodeToGlade.mungeFile( file);",
928 " \t\tvar builder = new Gtk.Builder.from_string (xmlstr, xmlstr.length);",
929 " \t\tvar obj = (Gtk.Widget) builder.get_object(\"w\"+ file.tree.oid.to_string());",
930 " \t\t this.container.el.append(obj);",
932 " this.createThumb();",
940 "| void scroll_to_line" : [
942 " // code preview...",
944 " GLib.Timeout.add(100, () => {",
947 "\t this.notebook.el.set_current_page(1);",
949 "\t\t var buf = this.sourceview.el.get_buffer();",
951 "\t\tvar sbuf = (GtkSource.Buffer) buf;",
954 "\t\tGtk.TextIter iter; ",
955 "\t\tsbuf.get_iter_at_line(out iter, line);",
956 "\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
964 "| void updateErrorMarks" : [
969 "\tvar buf = _this.buffer.el;",
970 "\tGtk.TextIter start;",
971 "\tGtk.TextIter end; ",
972 "\tbuf.get_bounds (out start, out end);",
976 "\t//GLib.debug(\"highlight errors\");\t\t ",
978 "\t // we should highlight other types of errors..",
983 "\tif (_this.file == null) {",
984 "\t\tGLib.debug(\"file is null?\");",
988 "\tvar ar = this.file.getErrors();",
989 "\tif (ar.size < 1) {",
990 "\t\tbuf.remove_tag_by_name (\"ERR\", start, end);",
991 "\t\tbuf.remove_tag_by_name (\"WARN\", start, end);",
992 "\t\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
993 "\t\tbuf.remove_source_marks (start, end, \"ERR\");",
994 "\t\tbuf.remove_source_marks (start, end, \"WARN\");",
995 "\t\tbuf.remove_source_marks (start, end, \"DEPR\");",
996 "\t\tthis.last_error_counter = file.error_counter ;",
997 "\t\t//GLib.debug(\"higjlight has no errors\");",
1000 " \tif (this.last_error_counter == file.error_counter) {",
1008 "\tvar tlines = buf.get_line_count () +1;",
1012 "\tbuf.remove_source_marks (start, end, \"ERR\");",
1013 "\tbuf.remove_source_marks (start, end, \"WARN\");",
1014 "\tbuf.remove_source_marks (start, end, \"DEPR\");",
1015 "\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1016 "\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1017 "\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1018 "\tforeach(var diag in ar) { ",
1021 "\t Gtk.TextIter iter;",
1022 "// print(\"get inter\\n\");",
1023 "\t var eline = (int)diag.range.start.line ;",
1024 "\t var eline_to = (int)diag.range.end.line;",
1025 "\t if (eline > tlines || eline < 0) {",
1030 "\t buf.get_iter_at_line( out iter, eline);",
1032 "\t \t buf.get_iter_at_line_offset( out start, ",
1033 " \t \teline, (int)diag.range.start.character); ",
1034 " \t buf.get_iter_at_line_offset( out end, ",
1035 " \t \teline_to, (int)diag.range.end.character); ",
1037 "\t buf.apply_tag_by_name(diag.category, start, end);",
1040 "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
1041 "\t buf.create_source_mark( msg, diag.category, iter);",
1042 "\t GLib.debug(\"set line %d to %s\", eline, msg);",
1043 "\t //this.marks.set(eline, msg);",
1045 "\tthis.last_error_counter = file.error_counter ;",