2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# GtkSource.SearchContext searchcontext" : "null",
7 "# JsRender.JsRender? file" : "null",
8 "# JsRender.Node node" : "null",
9 "# JsRender.NodeProp? prop" : "null",
10 "# Xcls_MainWindow window" : "null",
11 "# bool dirty" : false,
13 "# int last_error_counter" : 0,
14 "# int pos_root_x" : "",
15 "# int pos_root_y" : "",
16 "# string activeEditor" : "\"\"",
17 "$ homogeneous" : false,
20 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
21 "bool hexpand" : true,
22 "bool vexpand" : true,
23 "int last_search_end" : 0,
27 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
28 "bool shrink_end_child" : false,
29 "int width_request" : 200,
33 "* prop" : "start_child",
34 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
38 "$ homogeneous" : false,
40 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
41 "bool hexpand" : true,
42 "bool vexpand" : false,
46 "bool vexpand" : true,
52 " _this.saveContents();",
61 "Gtk.Justification justify" : "Gtk.Justification.LEFT",
62 "bool hexpand" : true,
65 "int margin_start" : 4,
68 "(Lsp.Hover? help) {",
69 "\tif (help == null || help.contents == null",
70 "\t\t|| help.contents.size < 1) {",
71 "\t\tthis.el.set_text(\"\");",
74 "\tvar sig = help.contents.get(0).value.split(\" \");",
75 "\tstring[] str = {};",
76 "\tfor(var i =0; i < sig.length; i++) {",
78 "\t\tswitch(sig[i]) {",
79 "\t\t\tcase \"public\":",
80 "\t\t\tcase \"private\":",
81 "\t\t\tcase \"protected\":",
82 "\t\t\tcase \"async\":",
83 "\t\t\tcase \"class\":",
89 "\t\t\t\tstr += sig[i];",
95 "\t\t\t\tstr += (\"<span underline=\\\"single\\\" color=\\\"blue\\\" >\" + ",
96 "\t\t\t\t\tGLib.Markup.escape_text(sig[i])",
97 "\t\t\t\t\t+\"</span>\");",
101 "\tif (help.contents.size > 1) {",
102 "\t\tsig += (\"\\n\\n\" + help.contents[1].value);",
105 "\tthis.el.set_markup(string.joinv(\" \",str));",
112 "* ctor" : "new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1)",
115 "\t//this.el.set_range(6,30);",
116 " \tthis.el.set_value ( BuilderApplication.settings.editor_font_size);",
117 " \tBuilderApplication.settings.editor_font_size_updated.connect(",
119 " \t\t\tBuilderApplication.settings.editor_font_size_inchange = true;",
120 " \t\t//\tGLib.debug(\"update range\");",
121 " \t\t \tthis.el.set_value (BuilderApplication.settings.editor_font_size);",
122 " \t\t \tBuilderApplication.settings.editor_font_size_inchange = false;",
130 "bool draw_value" : false,
131 "bool has_origin" : true,
132 "bool sensitive" : true,
134 "int width_request" : 200,
138 "\tif (BuilderApplication.settings.editor_font_size_inchange) {",
141 " \tBuilderApplication.settings.editor_font_size = val;",
155 "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
156 "string icon_name" : "window-close",
163 " _this.saveContents();",
164 " _this.window.windowstate.switchState(WindowState.State.PREVIEW);",
169 "string icon_name" : "window-close",
177 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
178 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
179 "bool overlay_scrolling" : false,
180 "bool vexpand" : true,
181 "id" : "RightEditor",
184 "# Gtk.CssProvider css" : "null",
185 "$ gboolean auto_indent" : true,
186 "$ xns" : "GtkSource",
193 "this.el.completion.add_provider(",
194 "\tnew Palete.CompletionProvider(_this)",
197 "// hover seems pretty useless.. - ??",
198 "//var hover = this.el.get_hover();",
199 "//hover.add_provider(new Palete.HoverProvider(_this));",
201 "//this.el.completion.unblock_interactive();",
202 "this.el.completion.select_on_show = true; // select",
203 "//this.el.completion.remember_info_visibility\t = true;",
206 "var attrs = new GtkSource.MarkAttributes();",
208 "attrs.set_icon_name ( \"process-stop\"); ",
209 "attrs.query_tooltip_text.connect(( mark) => {",
210 " GLib.debug(\"tooltip query? %s\", mark.name);",
211 " return strdup( mark.name);",
213 " attrs.query_tooltip_markup.connect(( mark) => {",
214 " GLib.debug(\"tooltip query? %s\", mark.name);",
215 " return strdup( mark.name);",
217 "this.el.set_mark_attributes (\"ERR\", attrs, 1);",
221 "var wattrs = new GtkSource.MarkAttributes();",
222 "wattrs.set_icon_name ( \"process-stop\"); ",
223 "wattrs.query_tooltip_text.connect(( mark) => {",
224 " GLib.debug(\"tooltip query? %s\", mark.name);",
225 " return strdup(mark.name);",
227 "wattrs.query_tooltip_markup.connect(( mark) => {",
228 " GLib.debug(\"tooltip query? %s\", mark.name);",
229 " return strdup(mark.name);",
231 "this.el.set_mark_attributes (\"WARN\", wattrs, 1);",
235 "var dattrs = new GtkSource.MarkAttributes();",
237 "dattrs.set_icon_name ( \"process-stop\"); ",
239 "dattrs.query_tooltip_text.connect(( mark) => {",
240 "\tGLib.debug(\"tooltip query? %s\", mark.name);",
241 " return strdup(mark.name);",
243 "//dattrs.query_tooltip_markup.connect(( mark) => {",
244 "//\tGLib.debug(\"tooltip query? %s\", mark.name);",
245 " // return strdup(mark.name);",
247 "this.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
250 " this.el.get_space_drawer().set_matrix(null);",
251 " this.el.get_space_drawer().set_types_for_locations( ",
252 "\tGtkSource.SpaceLocationFlags.ALL,",
253 "\tGtkSource.SpaceTypeFlags.ALL",
255 "this.el.get_space_drawer().set_enable_matrix(true);",
259 "bool has_tooltip" : true,
260 "bool hexpand" : true,
261 "bool insert_spaces_instead_of_tabs" : true,
262 "bool vexpand" : true,
263 "boolean show_line_marks" : true,
264 "boolean show_line_numbers" : true,
265 "css_classes" : "{ \"code-editor\" }",
266 "gboolean highlight_current_line" : true,
271 "$ Gee.HashMap<int,string>? xmarks" : "null",
272 "$ xns" : "GtkSource",
273 "$ xtype" : "Buffer",
276 "var buf = this.el;",
277 "buf.create_tag (\"bold\", \"weight\", Pango.Weight.BOLD);",
278 "buf.create_tag (\"type\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#204a87\");",
279 "buf.create_tag (\"keyword\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#a40000\");",
280 "buf.create_tag (\"text\", \"weight\", Pango.Weight.NORMAL, \"foreground\", \"#729fcf\");",
281 "buf.create_tag (\"number\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#ad7fa8\");",
282 "buf.create_tag (\"method\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#729fcf\");",
283 "buf.create_tag (\"property\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#BC1F51\");",
284 "buf.create_tag (\"variable\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#A518B5\");",
287 "buf.create_tag (\"ERR\", \"weight\", Pango.Weight.BOLD, \"background\", \"pink\");",
288 "buf.create_tag (\"WARN\", \"weight\", Pango.Weight.BOLD, \"background\", \"#ABF4EB\");",
289 "buf.create_tag (\"DEPR\", \"weight\", Pango.Weight.BOLD, \"background\", \"#EEA9FF\");",
295 "bool check_queued" : false,
296 "bool enable_undo" : true,
297 "bool highlight_matching_brackets" : true,
298 "bool highlight_syntax" : true,
300 "int error_line" : "-1",
304 " // check syntax??",
306 " _this.save_button.el.sensitive = true;",
307 " print(\"EDITOR CHANGED\");",
308 " this.checkSyntax();",
310 " _this.dirty = true;",
312 " // this.get('/LeftPanel.model').changed( str , false);",
320 "\tGtk.TextIter iter;",
321 "\tthis.el.get_iter_at_offset (",
322 "\t\t\tout iter, this.el.cursor_position);",
324 "\t_this.navigation.updateSelectedLine(",
325 "\t\t\t(uint)iter.get_line(),",
326 "\t\t\t(uint)iter.get_line_offset()",
334 "| bool OLDhighlightErrorsJson" : [
335 "(string type, Json.Object obj) {",
336 "\tGtk.TextIter start;",
337 "\tGtk.TextIter end; ",
338 "\tthis.el.get_bounds (out start, out end);",
340 "\tthis.el.remove_source_marks (start, end, type);",
341 "\tGLib.debug(\"highlight errors\");\t\t ",
343 "\t // we should highlight other types of errors..",
345 "\tif (!obj.has_member(type)) {",
346 "\t\tGLib.debug(\"Return has no errors\\n\");",
350 "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
352 "\t\t_this.window.windowstate.state != WindowState.State.CODE",
354 "\t\tGLib.debug(\"windowstate != CODEONLY?\");",
359 "\t//this.marks = new Gee.HashMap<int,string>();",
360 "\tvar err = obj.get_object_member(type);",
362 "\tif (_this.file == null) {",
363 "\t\tGLib.debug(\"file is null?\");",
367 "\tvar valafn = _this.file.path;",
369 "\tif (_this.file.xtype != \"PlainFile\") {",
371 "\t\tvalafn = \"\";",
373 "\t\t\tvar regex = new Regex(\"\\\\.bjs$\");",
374 "\t\t\t// should not happen",
375 "\t \t\tvalafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
376 "\t\t} catch (GLib.RegexError e) {",
377 "\t\t\treturn true;",
383 "\tif (!err.has_member(valafn)) {",
384 "\t\tGLib.debug(\"File path has no errors\");",
388 "\tvar lines = err.get_object_member(valafn);",
391 "\tif (obj.has_member(\"line_offset\")) { // ?? why??",
392 "\t\toffset = (int)obj.get_int_member(\"line_offset\") + 1;",
396 "\tvar tlines = this.el.get_line_count () +1;",
398 "\tif (_this.prop != null) {",
400 "\t\ttlines = _this.prop.end_line + 1;",
401 "\t\toffset = _this.prop.start_line + 1;",
407 "\tlines.foreach_member((obj, line, node) => {",
409 "\t Gtk.TextIter iter;",
410 "// print(\"get inter\\n\");",
411 "\t var eline = int.parse(line) - offset;",
412 "\t GLib.debug(\"GOT ERROR on line %s -- converted to %d (offset = %d)\\n\", line,eline, offset);",
415 "\t if (eline > tlines || eline < 0) {",
420 "\t this.el.get_iter_at_line( out iter, eline);",
421 "\t //print(\"mark line\\n\");",
422 "\t var msg = \"\";",
423 "\t var ar = lines.get_array_member(line);",
424 "\t for (var i = 0 ; i < ar.get_length(); i++) {",
425 "\t \tif (ar.get_string_element(i) == \"Success\") {",
428 "\t\t\tmsg += (msg.length > 0) ? \"\\n\" : \"\";",
429 "\t\t\tmsg += ar.get_string_element(i);",
431 "\t\tif (msg == \"\") {",
434 "\t\tmsg = \"Line: %d\".printf(eline+1) + \" \" + msg;",
435 "\t this.el.create_source_mark(msg, type, iter);",
436 "\t GLib.debug(\"set line %d to %m\", eline, msg);",
437 "\t // this.marks.set(eline, msg);",
448 "| bool checkSyntax" : [
452 " var str = this.toString();",
455 " if (this.error_line > 0) {",
456 " Gtk.TextIter start;",
457 " Gtk.TextIter end; ",
458 " this.el.get_bounds (out start, out end);",
460 " this.el.remove_source_marks (start, end, null);",
462 " if (str.length < 1) {",
463 " print(\"checkSyntax - empty string?\\n\");",
467 " // bit presumptiona",
468 " if (_this.file.xtype == \"PlainFile\") {",
470 " // assume it's gtk...",
471 " var oldcode =_this.file.toSource();",
472 " _this.file.setSource(str);",
473 "\t BuilderApplication.showSpinner(\"appointment soon\",\"document change pending\");",
474 " \t_this.file.getLanguageServer().document_change(_this.file);",
475 "\t\t_this.file.getLanguageServer().queueDocumentSymbols(_this.file);",
476 " _this.file.setSource(oldcode);",
482 " if (_this.file == null) {",
490 " GLib.debug(\"calling validate\"); ",
491 " // clear the buttons.",
492 " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
495 "\tvar oldcode = _this.prop.val;",
497 "\t_this.prop.val = str;",
498 "\t_this.node.updated_count++;",
499 " _this.file.getLanguageServer().document_change(_this.file);",
500 " _this.node.updated_count++;",
501 " _this.prop.val = oldcode;",
504 " //print(\"done mark line\\n\");",
506 " return true; // at present allow saving - even if it's invalid..",
510 "| bool highlightErrors" : [
511 "( Gee.HashMap<int,string> validate_res) {",
513 "\tthis.error_line = validate_res.size;",
515 "\tif (this.error_line < 1) {",
518 "\tvar tlines = this.el.get_line_count ();",
519 "\tGtk.TextIter iter;",
520 "\tvar valiter = validate_res.map_iterator();",
521 "\twhile (valiter.next()) {",
523 "\t// print(\"get inter\\n\");",
524 "\t\tvar eline = valiter.get_key();",
525 "\t\tif (eline > tlines) {",
528 "\t\tthis.el.get_iter_at_line( out iter, eline);",
529 "\t\t//print(\"mark line\\n\");",
530 "\t\tthis.el.create_source_mark(valiter.get_value(), \"ERR\", iter);",
535 "| string toString" : [
540 " this.el.get_start_iter(out s);",
541 " this.el.get_end_iter(out e);",
542 " var ret = this.el.get_text(s,e,true);",
543 " //print(\"TO STRING? \" + ret);",
550 "# bool is_control" : false,
555 "(keyval, keycode, state) => {",
557 " \tif (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
558 " \t\tthis.is_control = true;",
565 "(keyval, keycode, state) => {",
567 " \t if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
568 " \t\tthis.is_control = false;",
570 " if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
571 " GLib.debug(\"SAVE: ctrl-S pressed\");",
572 " _this.saveContents();",
576 " if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
577 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
578 "\t\t_this.forwardSearch(true);",
581 "\tif (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
582 "\t GLib.debug(\"SAVE: ctrl-f pressed\");",
583 "\t\t_this.search_entry.el.grab_focus();",
584 "\t\t_this.search_entry.el.select_region(0,-1);",
587 "\tif (keyval == Gdk.Key.space && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
588 "\t\t_this.view.el.show_completion();",
591 "\tGtk.TextIter iter;",
592 "\t_this.buffer.el.get_iter_at_offset( out iter, _this.buffer.el.cursor_position); ",
593 "\tvar line = iter.get_line();",
594 "\tvar offset = iter.get_line_offset();",
595 "\tGLib.debug(\"line %d off %d\", line ,offset);",
596 "\tif (_this.prop != null) {",
597 "\t\tline += _this.prop.start_line + 1; // i think..",
598 "\t\toffset += 12; // should probably be 8 without namespaced ",
599 "\t\tGLib.debug(\"guess line %d off %d\", line ,offset);",
601 " //_this.view.el.show_completion();",
602 " // print(event.key.keyval)",
612 "xtype" : "EventControllerKey"
615 "# double distance" : "0.0f",
617 "Gtk.EventControllerScrollFlags flags" : "Gtk.EventControllerScrollFlags.VERTICAL",
621 "\tif (!_this.keystate.is_control) {",
624 "\t //GLib.debug(\"scroll %f\", dy);",
626 "\tthis.distance += dy;",
628 "\t//GLib.debug(\"scroll %f / %f\", dy, this.distance);",
630 "\t if (this.distance < -1) {",
632 "\t\tBuilderApplication.settings.editor_font_size ++;",
633 "\t\tthis.distance = 0;",
635 "\tif (this.distance > 1) {",
636 "\t\tBuilderApplication.settings.editor_font_size --;",
637 "\t\tthis.distance = 0;",
645 "xtype" : "EventControllerScroll"
651 "(n_press, x, y) => {",
652 "\tGtk.TextIter iter;",
653 "\tint buffer_x, buffer_y;",
654 "\tvar gut = _this.view.el.get_gutter(Gtk.TextWindowType.LEFT);",
656 "\t _this.view.el.window_to_buffer_coords (Gtk.TextWindowType.TEXT,",
657 "\t\t(int)x - gut.get_width(), (int)y,",
658 " \t\tout buffer_x, out buffer_y);",
659 "\t_this.view.el.get_iter_at_location (out iter, ",
660 "\t\t\tbuffer_x, buffer_y);;",
663 "\tif (_this.buffer.el.iter_has_context_class(iter, \"comment\") ||",
664 "\t\t_this.buffer.el.iter_has_context_class(iter, \"string\")",
671 "\tvar back = iter.copy();",
672 "\tback.backward_char();",
674 "\tvar forward = iter.copy();",
675 "\tforward.forward_char();",
677 "\t// what's the character at the iter?",
678 "\tvar str = back.get_text(iter);",
679 "\tstr += iter.get_text(forward);",
680 "\tif (str.strip().length < 1) {",
683 "\tvar offset = iter.get_line_offset();",
684 "\tvar line = iter.get_line();",
685 "\tif (_this.prop != null) {",
687 "\t\tline += _this.prop.start_line ; ",
688 "\t\t\t\t\t// this is based on Gtk using tabs (hence 1/2 chars);",
689 "\t\toffset += _this.node.node_pad.length;",
690 "\t\t\t\t\t// javascript listeners are indented 2 more spaces.",
691 "\t\tif (_this.prop.ptype == JsRender.NodePropType.LISTENER) {",
692 "\t\t\toffset += 2;",
696 "\tvar ls = _this.file.getLanguageServer();",
698 "\t\t_this.file, line, offset,",
700 "\t\t\tvar res = ls.hover.end(o );",
701 "\t\t\t_this.helper.setHelp(res);",
710 "xtype" : "GestureClick"
715 "(x, y, keyboard_tooltip, tooltip) => {",
717 "\t//GLib.debug(\"query tooltip\");",
718 "\tGtk.TextIter iter;",
721 "\tvar yoff = (int) _this.RightEditor.el.vadjustment.value;",
723 "\t// I think this is problematic - if it's compliing / updating at same time as query.",
725 "\t//if (_this.window.statusbar_compile_spinner.el.spinning) {",
726 "\t//\treturn false;",
729 "\tthis.el.get_iter_at_position (out iter, out trailing, x, y + yoff);",
731 "\tvar l = iter.get_line();",
735 "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
741 "\tif (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {",
742 "\t\tGLib.debug(\"line %d setting tip to %s\", l, _this.buffer.marks.get(l));",
743 "\t\ttooltip.set_text(_this.buffer.marks.get(l).dup());",
751 "\t// this crashes?? - not sure why.",
752 "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
753 "\tif (marks.is_empty()) {",
754 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
756 "\tif (marks.is_empty()) {",
757 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
760 "\t// GLib.debug(\"query tooltip line %d marks %d\", (int)l, (int) marks.length());",
762 "\tmarks.@foreach((m) => { ",
763 "\t\t//GLib.debug(\"got mark %s\", m.name);",
764 "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.category + \": \" + m.name;",
766 "\t// true if there is a mark..",
767 "\tif (str.length > 0 ) {",
768 "\t\ttooltip.set_text( str );",
770 "\treturn str.length > 0 ? true : false;",
776 "string name" : "editor-view",
777 "uint tab_width" : 4,
782 "// show the help page for the active node..",
783 " //this.get('/Help').show();",
785 " // this.get('/BottomPane').el.set_current_page(0);",
786 " \tGLib.debug(\"load called - Reset undo buffer\");",
788 " var buf = (GtkSource.Buffer)this.el.get_buffer();",
789 " buf.begin_irreversible_action();",
790 " buf.set_text(str, str.length);",
791 " buf.end_irreversible_action();",
793 " var lm = GtkSource.LanguageManager.get_default();",
794 " var lang = \"vala\";",
795 " if (_this.file != null) {",
796 " lang = _this.file.language;",
798 " print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);",
799 " var lg = _this.file.content_type.length > 0 ?",
800 " lm.guess_language(_this.file.path, _this.file.content_type) :",
801 " lm.get_language(lang);",
804 " ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg); ",
806 " this.el.insert_spaces_instead_of_tabs = true;",
807 " if (lg != null) {",
808 "\t\tprint(\"sourcelanguage = %s\\n\", lg.name);",
809 "\t\tif (lg.name == \"Vala\") {",
810 "\t\t this.el.insert_spaces_instead_of_tabs = false;",
813 " _this.dirty = false;",
814 " this.el.grab_focus();",
815 " _this.save_button.el.sensitive = false;",
816 " _this.last_error_counter = -1;",
821 "xtype" : "ScrolledWindow"
826 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
827 "bool homogeneous" : false,
828 "bool vexpand" : false,
833 "Gtk.CssProvider css" : "",
834 "bool hexpand" : true,
835 "id" : "search_entry",
841 "(keyval, keycode, state) => {",
843 "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
844 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
845 "\t\t_this.forwardSearch(true);",
850 " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
851 "\t\t_this.forwardSearch(true);",
857 " // print(event.key.keyval)",
864 "xtype" : "EventControllerKey"
871 "_this.search(_this.search_entry.el.text);",
872 "\t _this.search_results.updateResults();",
874 "\tGLib.Timeout.add_seconds(1,() => {",
875 "\t\t _this.search_results.updateResults();",
876 "\t\t return false;",
882 "string name" : "editor-search-entry",
883 "string placeholder_text" : "Press enter to search",
884 "uint search_delay" : 3,
885 "xtype" : "SearchEntry",
886 "| void forwardSearch" : [
887 "(bool change_focus) {",
890 "\t_this.forwardSearch(change_focus);",
894 "\tswitch(_this.windowstate.state) {",
895 "\t\tcase WindowState.State.CODEONLY:",
896 "\t\t//case WindowState.State.CODE:",
897 "\t\t\t// search the code being edited..",
898 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
901 "\t\tcase WindowState.State.PREVIEW:",
902 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
903 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
905 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
918 "id" : "search_results",
919 "int margin_end" : 4,
920 "int margin_start" : 4,
921 "string label" : "No Results",
923 "| void updateResults" : [
925 "\tthis.el.visible = true;",
927 "\tvar res = _this.searchcontext.get_occurrences_count();",
929 "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
933 "\t_this.nextBtn.el.sensitive = false;",
934 "\t_this.backBtn.el.sensitive = false;\t",
937 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
938 "\t\t_this.nextBtn.el.sensitive = true;",
939 "\t\t_this.backBtn.el.sensitive = true;",
942 "\t_this.search_results.el.label = \"No Matches\";",
949 "bool always_show_image" : true,
950 "bool sensitive" : false,
956 "\t_this.forwardSearch(true);",
963 "string icon_name" : "go-down",
968 "bool always_show_image" : true,
969 "bool sensitive" : false,
975 "\t_this.backSearch(true);",
981 "string icon_name" : "go-up",
986 "bool always_show_arrow" : true,
987 "bool always_show_image" : true,
991 "* prop" : "popover",
992 "id" : "search_settings",
997 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1004 "\tthis.el.show();",
1008 "id" : "case_sensitive",
1009 "string label" : "Case Sensitive",
1010 "xtype" : "CheckButton"
1016 "\tthis.el.show();",
1021 "string label" : "Regex",
1022 "xtype" : "CheckButton"
1027 "string label" : "Multi-line (add \\n)",
1028 "xtype" : "CheckButton"
1037 "string icon_name" : "emblem-system",
1038 "xtype" : "MenuButton"
1048 "* prop" : "end_child",
1049 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1050 "bool hexpand" : true,
1051 "bool vexpand" : true,
1056 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1062 "bool hexpand" : true,
1063 "bool vexpand" : true,
1064 "bool visible" : false,
1065 "id" : "navigationwindow",
1068 "# int last_selected_line" : "-1",
1069 "$ Gtk.Widget? selected_row" : "null",
1072 "id" : "navigation",
1076 "bool expand" : true,
1080 "* prop" : "factory",
1085 "\t// GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1087 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1088 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1091 "\tvar hbox = (Gtk.Box) expand.child;",
1094 "\tvar img = (Gtk.Image) hbox.get_first_child();",
1095 "\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1097 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1098 "\tvar sym = (Lsp.DocumentSymbol) lr.get_item();",
1100 "\tsym.set_data<Gtk.Widget>(\"widget\", expand.get_parent());",
1101 "\texpand.get_parent().get_parent().set_data<Lsp.DocumentSymbol>(\"symbol\", sym);",
1103 "\t//GLib.debug(\"save sym on %s\", expand.get_parent().get_parent().get_type().name());",
1105 "\t//GLib.debug(\"got %d children for %s\" , (int)sym.children.get_n_items(), sym.name);",
1107 " expand.set_hide_expander( sym.children.get_n_items() < 1);",
1108 " \texpand.set_list_row(lr);",
1109 " \t//this.in_bind = true;",
1110 " \t// default is to expand",
1112 " \t//this.in_bind = false;",
1114 " \tsym.bind_property(\"symbol_icon\",",
1115 " img, \"icon_name\",",
1116 " GLib.BindingFlags.SYNC_CREATE);",
1118 " \thbox.css_classes = { sym.symbol_icon };",
1120 " \tsym.bind_property(\"name\",",
1122 " GLib.BindingFlags.SYNC_CREATE);",
1123 " \t// should be better?- --line no?",
1124 " \tsym.bind_property(\"tooltip\",",
1125 " lbl, \"tooltip_markup\",",
1126 " GLib.BindingFlags.SYNC_CREATE);",
1127 " \t// bind image...",
1135 "\tvar expand = new Gtk.TreeExpander();",
1137 "\texpand.set_indent_for_depth(true);",
1138 "\texpand.set_indent_for_icon(true);",
1139 "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1140 "\tvar icon = new Gtk.Image();",
1141 "\tvar lbl = new Gtk.Label(\"\");",
1142 "\tlbl.use_markup = true;",
1143 "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
1145 "\ticon.margin_end = 4;",
1146 " \tlbl.justify = Gtk.Justification.LEFT;",
1147 " \tlbl.xalign = 0;",
1149 "//\tlistitem.activatable = true; ??",
1151 "\thbox.append(icon);",
1152 "\thbox.append(lbl);",
1153 "\texpand.set_child(hbox);",
1154 "\t((Gtk.ListItem)listitem).set_child(expand);",
1160 "xtype" : "SignalListItemFactory"
1163 "string title" : "Code Navigation",
1164 "xtype" : "ColumnViewColumn"
1169 "id" : "navigationselmodel",
1174 "id" : "navigationsort",
1177 "$ Gtk.TreeListModelCreateModelFunc create_func" : [
1180 "\treturn ((Lsp.DocumentSymbol)item).children;",
1186 "bool autoexpand" : true,
1187 "bool passthrough" : false,
1190 "$ GLib.Type item_type" : "typeof(Lsp.DocumentSymbol)",
1193 "id" : "navliststore",
1194 "xtype" : "ListStore",
1195 "| Lsp.DocumentSymbol? symbolAtLine" : [
1196 "(uint line, uint chr) {",
1199 "\tfor(var i = 0; i < this.el.get_n_items();i++) {",
1200 "\t\tvar el = (Lsp.DocumentSymbol)this.el.get_item(i);",
1201 "\t\t//GLib.debug(\"Check sym %s : %d-%d\",",
1202 "\t\t//\tel.name , (int)el.range.start.line,",
1203 "\t\t//\t(int)el.range.end.line",
1205 "\t\tvar ret = el.containsLine(line,chr);",
1206 "\t\tif (ret != null) {",
1207 "\t\t\treturn ret;",
1219 "(position, removed, added) => {",
1220 "\tGLib.debug(\"tree item changed %d , %d , %d\",(int) position, (int)removed, (int) added);",
1221 "\t if (added < 1) { ",
1224 "\t//var sym = (Lsp.DocumentSymbol) this.el.get_item(position);",
1225 "\tvar row = this.el.get_row(position);",
1227 "\tGLib.debug(\"got %s\", row.get_item().get_type().name());",
1234 "xtype" : "TreeListModel"
1238 "* prop" : "sorter",
1242 "* prop" : "sorter",
1245 "$ GLib.Type this_type" : "typeof(Lsp.DocumentSymbol)",
1247 "* prop" : "expression",
1248 "string property_name" : "sort_key",
1249 "xtype" : "PropertyExpression"
1252 "xtype" : "StringSorter"
1255 "xtype" : "TreeListRowSorter"
1258 "xtype" : "SortListModel",
1259 "| Lsp.DocumentSymbol? getSymbolAt" : [
1262 " var tr = (Gtk.TreeListRow)this.el.get_item(row);",
1264 " var a = tr.get_item();; ",
1265 " GLib.debug(\"get_item (2) = %s\", a.get_type().name());",
1268 " return (Lsp.DocumentSymbol)tr.get_item();",
1272 "| int getRowFromSymbol" : [
1273 "(Lsp.DocumentSymbol sym) {",
1275 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1276 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1278 "\t\tif (sym.equals( (Lsp.DocumentSymbol)tr.get_item())) {",
1285 "| void collapseOnLoad" : [
1287 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1288 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1289 "\t\tvar sym = (Lsp.DocumentSymbol)tr.get_item();",
1290 "\t\tswitch (sym.kind) {",
1291 "\t \t\tcase Lsp.SymbolKind.Enum: ",
1292 "\t \t\t\ttr.expanded = false;",
1295 "\t\t\t\t//tr.expanded = true;",
1307 "xtype" : "NoSelection"
1313 "(n_press, x, y) => {",
1315 " \tvar row = _this.navigation.getRowWidgetAt(x,y, out pos );",
1317 " if (row == null) {",
1318 "\t GLib.debug(\"no row selected items\");",
1321 "\tGLib.debug(\"got click on %s\", row.get_type().name()); ",
1322 " //Lsp.DocumentSymbol",
1323 " var sym = row.get_data<Lsp.DocumentSymbol>(\"symbol\");",
1324 " if (sym == null) {",
1330 " \"line\" : 1410,",
1331 " \"character\" : 8",
1334 " \"line\" : 1410,",
1335 " \"character\" : 39",
1339 " GLib.debug(\"goto line %d\", (int)sym.range.start.line); ",
1340 " _this.scroll_to_line((int)sym.range.start.line);",
1341 " Gtk.TextIter iter;",
1342 " _this.buffer.el.get_iter_at_line_offset(out iter, ",
1343 " \t(int)sym.range.start.line,",
1344 " \t(int)sym.range.start.character",
1346 " _this.buffer.el.place_cursor(iter);",
1351 "xtype" : "GestureClick"
1354 "string name" : "editor-navigation",
1355 "xtype" : "ColumnView",
1356 "| Gtk.Widget? getRowWidgetAt" : [
1357 "(double x, double y, out string pos) {",
1360 "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1361 "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1362 "\tif (w == null) {",
1366 "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1367 "\tif (row == null) {",
1371 "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1375 "\t//GLib.debug(\"row number is %d\", rn);",
1376 "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1377 "\t// above or belw",
1378 "\tGraphene.Rect bounds;",
1379 "\trow.compute_bounds(this.el, out bounds);",
1380 "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1381 "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1382 "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1384 "\tvar ypos = y - bounds.get_y();",
1385 "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1386 "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1387 "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1388 "\tpos = \"over\";",
1390 "\tif (rpos > 80) {",
1391 "\t\tpos = \"below\";",
1392 "\t} else if (rpos < 20) {",
1393 "\t\tpos = \"above\";",
1398 "| int getRowAt" : [
1399 "(double x, double y, out string pos) {",
1402 "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1403 "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1404 "\tif (w == null) {",
1408 "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1409 "\tif (row == null) {",
1413 "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1418 "\twhile (cr.get_prev_sibling() != null) {",
1420 "\t\tcr = cr.get_prev_sibling();",
1423 "\t//GLib.debug(\"row number is %d\", rn);",
1424 "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1425 "\t// above or belw",
1426 "\tGraphene.Rect bounds;",
1427 "\trow.compute_bounds(this.el, out bounds);",
1428 "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1429 "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1430 "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1432 "\tvar ypos = y - bounds.get_y();",
1433 "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1434 "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1435 "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1436 "\tpos = \"over\";",
1438 "\tif (rpos > 80) {",
1439 "\t\tpos = \"below\";",
1440 "\t} else if (rpos < 20) {",
1441 "\t\tpos = \"above\";",
1447 "(Gee.ArrayList<Lsp.DocumentSymbol> syms) {",
1448 "\t_this.navigationwindow.el.show();",
1449 "\t//_this.navliststore.el.remove_all();",
1452 "\tvar ls = new GLib.ListStore(typeof(Lsp.DocumentSymbol));",
1454 "\tforeach(var sym in syms) {",
1455 "\t\tls.append(sym);",
1457 "\tLsp.DocumentSymbol.copyList(ls, _this.navliststore.el);",
1458 "\t//_this.navliststore.el.append(sym);",
1459 "\tthis.last_selected_line = -1;",
1460 "\tGLib.Idle.add(() => {",
1461 "\t\t_this.navigationsort.collapseOnLoad();",
1462 "\t\tGtk.TextIter iter;",
1463 "\t\t_this.buffer.el.get_iter_at_offset (",
1464 "\t\t\t\tout iter, _this.buffer.el.cursor_position);",
1466 "\t\tGLib.debug(\"idle update scroll %d, %d\", iter.get_line(),",
1467 "\t\t\t\titer.get_line_offset());",
1468 "\t\tthis.updateSelectedLine(",
1469 "\t\t\t\t(uint)iter.get_line(),",
1470 "\t\t\t\t(uint)iter.get_line_offset()",
1472 "\t\treturn false;",
1477 "| void updateSelectedLine" : [
1478 "(uint line, uint chr) {",
1479 "\tif (line == this.last_selected_line) {",
1482 "\tGLib.debug(\"select line %d\", (int)line);",
1483 "\tthis.last_selected_line = (int)line;",
1486 "\tvar new_row = -1;",
1487 "\tvar sym = _this.navliststore.symbolAtLine(line, chr);",
1488 "\tif (sym != null) {",
1489 "\t \tnew_row = _this.navigationsort.getRowFromSymbol(sym);",
1490 " \t\tGLib.debug(\"select line %d - row found %d\", (int)line, new_row);",
1492 " \t\tGLib.debug(\" no symbol found at line %d\", (int)line);",
1495 "\tif (this.selected_row != null) { ",
1496 "\t\tGLib.debug(\" remove selected row\");",
1497 "\t\tthis.selected_row.remove_css_class(\"selected-row\");",
1499 "\tthis.selected_row = null;",
1500 "\tif (new_row > -1) {",
1501 "\t\tthis.el.scroll_to(new_row,null,Gtk.ListScrollFlags.NONE, null);",
1502 "\t\tvar row = sym.get_data<Gtk.Widget>(\"widget\");",
1503 "\t\tif (row != null) {",
1504 "\t\t\tGLib.debug(\" Add selected row\");",
1506 "\t\t\trow.add_css_class(\"selected-row\");",
1507 "\t\t\tthis.selected_row = row;",
1511 "\t\t\tGLib.debug(\"could not find widget on row %d\", new_row);",
1521 "xtype" : "ScrolledWindow"
1531 "| bool saveContents" : [
1535 " if (_this.file == null) {",
1541 " var str = _this.buffer.toString();",
1543 " _this.buffer.checkSyntax();",
1547 " // LeftPanel.model.changed( str , false);",
1548 " _this.dirty = false;",
1549 " _this.save_button.el.sensitive = false;",
1551 " // find the text for the node..",
1552 " if (_this.file.xtype != \"PlainFile\") {",
1553 " // in theory these properties have to exist!?!",
1554 " \tthis.prop.val = str;",
1555 " //this.window.windowstate.left_props.reload();",
1557 " _this.file.setSource( str );",
1560 " // call the signal..",
1568 "(string in_txt) {",
1570 "\tvar s = new GtkSource.SearchSettings();",
1571 "\ts.case_sensitive = _this.case_sensitive.el.active;",
1572 "\ts.regex_enabled = _this.regex.el.active;\t",
1573 "\ts.wrap_around = false;",
1575 "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
1576 "\tthis.searchcontext.set_highlight(true);",
1577 "\tvar txt = in_txt;",
1579 "\tif (_this.multiline.el.active) {",
1580 "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
1583 "\ts.set_search_text(txt);",
1584 "\tGtk.TextIter beg, st,en;",
1586 "\tthis.buffer.el.get_start_iter(out beg);",
1587 "\tbool has_wrapped_around;",
1588 "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
1589 "\tthis.last_search_end = 0;",
1591 "\treturn this.searchcontext.get_occurrences_count();",
1599 "| string tempFileContents" : [
1603 " if (_this.file == null) {",
1606 "\tvar str= this.buffer.toString();",
1607 "\tif (_this.file.xtype == \"PlainFile\") {",
1615 " GLib.debug(\"calling validate\"); ",
1616 " // clear the buttons.",
1617 " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
1618 "\t\treturn this.file.toSource(); ;",
1621 "\tvar oldcode = _this.prop.val;",
1622 "\t_this.prop.val = str;",
1623 " var ret = _this.file.toSource();",
1624 " _this.prop.val = oldcode;",
1629 "| void backSearch" : [
1630 "(bool change_focus) {",
1632 "\tif (this.searchcontext == null) {",
1636 "\tGtk.TextIter beg, st,en;",
1637 "\tbool has_wrapped_around;",
1638 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
1640 "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
1641 "\t\tthis.last_search_end = 0;",
1643 "\t\tthis.last_search_end = en.get_offset();",
1644 "\t\tif (change_focus) {",
1645 "\t\t\tthis.view.el.grab_focus();",
1647 "\t\tthis.buffer.el.place_cursor(st);",
1648 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
1654 "| void forwardSearch" : [
1655 "(bool change_focus) {",
1657 "\tif (this.searchcontext == null) {",
1661 "\tGtk.TextIter beg, st,en;",
1662 "\t bool has_wrapped_around;",
1663 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);",
1664 "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
1666 "\t\tthis.last_search_end = 0; // not sure if this should happen",
1668 "\t\tif (has_wrapped_around) {",
1672 "\t\tthis.last_search_end = en.get_offset();",
1673 "\t\tif (change_focus) {",
1674 "\t\t\tthis.view.el.grab_focus();",
1676 "\t\tthis.buffer.el.place_cursor(st);",
1677 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
1685 "\t this.file = null; ",
1687 " this.node = null;",
1688 " this.prop = null;",
1689 "\tthis.searchcontext = null;",
1694 "| void scroll_to_line" : [
1697 "\tGLib.Timeout.add(500, () => {",
1699 "\t\tvar buf = this.view.el.get_buffer();",
1701 "\t\tvar sbuf = (GtkSource.Buffer) buf;",
1704 "\t\tGtk.TextIter iter; ",
1705 "\t\tsbuf.get_iter_at_line(out iter, line);",
1706 "\t\tthis.view.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
1707 "\t\treturn false;",
1713 "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)",
1716 " if (this.file != null) {",
1717 " \tthis.file.navigation_tree_updated.disconnect(",
1718 " \t\t_this.navigation.show",
1721 " this.file = file; ",
1722 " this.file.navigation_tree_updated.connect(",
1723 "\t\t_this.navigation.show",
1725 " if (file.xtype != \"PlainFile\") {",
1726 " \tthis.prop = prop;",
1727 " this.node = node;",
1729 " // find the text for the node..",
1730 " this.view.load( prop.val );",
1731 " this.updateErrorMarks();",
1735 " this.close_btn.el.show(); ",
1738 " this.view.load( file.toSource() );",
1739 " this.updateErrorMarks();",
1740 " this.close_btn.el.hide();",
1741 " var ls = file.getLanguageServer();",
1742 " ls.queueDocumentSymbols(file);",
1743 " ////ls.documentSymbols.begin(file, (a,o) => {",
1744 " //\t_this.navigation.show(ls.documentSymbols.end(o)); ",
1746 " //documentSymbols",
1752 "| void updateErrorMarks" : [
1757 "\tvar buf = _this.buffer.el;",
1758 "\tGtk.TextIter start;",
1759 "\tGtk.TextIter end; ",
1760 "\tbuf.get_bounds (out start, out end);",
1765 "\t//GLib.debug(\"highlight errors\");\t\t ",
1767 "\t // we should highlight other types of errors..",
1769 "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
1771 "\t\t_this.window.windowstate.state != WindowState.State.CODE",
1773 "\t\t//GLib.debug(\"windowstate != CODEONLY?\");",
1779 "\tif (_this.file == null) {",
1780 "\t\tGLib.debug(\"file is null?\");",
1784 "\tvar ar = this.file.getErrors();",
1785 "\tif (ar.size < 1) {",
1786 "\t\tbuf.remove_source_marks (start, end, \"ERR\");",
1787 "\t\tbuf.remove_source_marks (start, end, \"WARN\");",
1788 "\t\tbuf.remove_source_marks (start, end, \"DEPR\");",
1789 "\t\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1790 "\t\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1791 "\t\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1792 "\t\tthis.last_error_counter = file.error_counter ;",
1793 "\t\t//GLib.debug(\"highlight %s : %s has no errors\", this.file.relpath, category);",
1798 " // basicaly check if there is no change, then we do not do any update..",
1799 " // we can do this by just using an error counter?",
1800 " // if that's changed then we will do an update, otherwise dont bother.",
1803 "\tvar offset = 0;",
1804 "\tvar hoffset = 0;",
1806 "\tvar tlines = buf.get_line_count () +1;",
1808 "\tif (_this.prop != null) {",
1809 "\t\t// this still seems flaky...",
1811 "\t\ttlines = _this.prop.end_line;",
1812 "\t\toffset = _this.prop.start_line;",
1813 "\t\thoffset = _this.node.node_pad.length + 2; //shift it left by 2 ? ..",
1817 "\t\t// no update...",
1818 "\t\tif (this.last_error_counter == file.error_counter) {",
1824 "\tbuf.remove_source_marks (start, end, \"ERR\");",
1825 "\tbuf.remove_source_marks (start, end, \"WARN\");",
1826 "\tbuf.remove_source_marks (start, end, \"DEPR\");",
1827 "\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1828 "\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1829 "\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1831 "\tforeach(var diag in ar) { ",
1832 "\t Gtk.TextIter iter;",
1833 "// print(\"get inter\\n\");",
1834 "\t var eline = (int)diag.range.start.line - offset;",
1835 "\t var eline_to = (int)diag.range.end.line - offset;",
1836 "\t //var eline = diag.range.end_line - offset;",
1837 "\t //GLib.debug(\"GOT ERROR on line %d -- converted to %d (offset = %d)\",",
1838 "\t //\terr.line ,eline, offset);",
1841 "\t if (eline > tlines || eline < 0) {",
1845 "\t buf.get_iter_at_line( out iter, eline);",
1846 "\t \tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
1847 "\t buf.create_source_mark( msg, diag.category, iter);",
1849 " \t var spos = (int)diag.range.start.character - hoffset;",
1850 " \t if (spos < 0) { spos =0 ; }",
1851 " \t if (spos > iter.get_chars_in_line()) {",
1852 " \t \tspos = iter.get_chars_in_line();",
1854 "\t\tbuf.get_iter_at_line( out iter, eline_to);",
1855 "\t\tvar epos = (int)diag.range.end.character - hoffset;",
1856 " \t if (epos < 0) { epos =0 ; }",
1857 " \t if (epos > iter.get_chars_in_line()) {",
1858 " \t \tepos = iter.get_chars_in_line();",
1862 " \t buf.get_iter_at_line_offset( out start, eline, spos); ",
1864 " \t buf.get_iter_at_line_offset( out end, eline_to,epos); ",
1866 "\t buf.apply_tag_by_name(diag.category, start, end);",
1868 "\t // GLib.debug(\"set line %d to %s\", eline, msg);",
1869 "\t //this.marks.set(eline, msg);",
1871 "\tthis.last_error_counter = file.error_counter ;",