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);",
548 "| void showHelp" : [
555 "# bool is_control" : false,
560 "(keyval, keycode, state) => {",
562 " \tif (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
563 " \t\tthis.is_control = true;",
570 "(keyval, keycode, state) => {",
572 " \t if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
573 " \t\tthis.is_control = false;",
575 " if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
576 " GLib.debug(\"SAVE: ctrl-S pressed\");",
577 " _this.saveContents();",
581 " if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
582 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
583 "\t\t_this.forwardSearch(true);",
586 "\tif (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
587 "\t GLib.debug(\"SAVE: ctrl-f pressed\");",
588 "\t\t_this.search_entry.el.grab_focus();",
589 "\t\t_this.search_entry.el.select_region(0,-1);",
592 "\tif (keyval == Gdk.Key.space && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
593 "\t\t_this.view.el.show_completion();",
596 "\tGtk.TextIter iter;",
597 "\t_this.buffer.el.get_iter_at_offset( out iter, _this.buffer.el.cursor_position); ",
598 "\tvar line = iter.get_line();",
599 "\tvar offset = iter.get_line_offset();",
600 "\tGLib.debug(\"line %d off %d\", line ,offset);",
601 "\tif (_this.prop != null) {",
602 "\t\tline += _this.prop.start_line + 1; // i think..",
603 "\t\toffset += 12; // should probably be 8 without namespaced ",
604 "\t\tGLib.debug(\"guess line %d off %d\", line ,offset);",
606 " //_this.view.el.show_completion();",
607 " // print(event.key.keyval)",
617 "xtype" : "EventControllerKey"
620 "# double distance" : "0.0f",
622 "Gtk.EventControllerScrollFlags flags" : "Gtk.EventControllerScrollFlags.VERTICAL",
626 "\tif (!_this.keystate.is_control) {",
629 "\t //GLib.debug(\"scroll %f\", dy);",
631 "\tthis.distance += dy;",
633 "\t//GLib.debug(\"scroll %f / %f\", dy, this.distance);",
635 "\t if (this.distance < -1) {",
637 "\t\tBuilderApplication.settings.editor_font_size ++;",
638 "\t\tthis.distance = 0;",
640 "\tif (this.distance > 1) {",
641 "\t\tBuilderApplication.settings.editor_font_size --;",
642 "\t\tthis.distance = 0;",
650 "xtype" : "EventControllerScroll"
656 "(n_press, x, y) => {",
657 "\tGtk.TextIter iter;",
658 "\tint buffer_x, buffer_y;",
659 "\tvar gut = _this.view.el.get_gutter(Gtk.TextWindowType.LEFT);",
661 "\t _this.view.el.window_to_buffer_coords (Gtk.TextWindowType.TEXT,",
662 "\t\t(int)x - gut.get_width(), (int)y,",
663 " \t\tout buffer_x, out buffer_y);",
664 "\t_this.view.el.get_iter_at_location (out iter, ",
665 "\t\t\tbuffer_x, buffer_y);;",
668 "\tif (_this.buffer.el.iter_has_context_class(iter, \"comment\") ||",
669 "\t\t_this.buffer.el.iter_has_context_class(iter, \"string\")",
676 "\tvar back = iter.copy();",
677 "\tback.backward_char();",
679 "\tvar forward = iter.copy();",
680 "\tforward.forward_char();",
682 "\t// what's the character at the iter?",
683 "\tvar str = back.get_text(iter);",
684 "\tstr += iter.get_text(forward);",
685 "\tif (str.strip().length < 1) {",
688 "\tvar offset = iter.get_line_offset();",
689 "\tvar line = iter.get_line();",
690 "\tif (_this.prop != null) {",
692 "\t\tline += _this.prop.start_line ; ",
693 "\t\t\t\t\t// this is based on Gtk using tabs (hence 1/2 chars);",
694 "\t\toffset += _this.node.node_pad.length;",
695 "\t\t\t\t\t// javascript listeners are indented 2 more spaces.",
696 "\t\tif (_this.prop.ptype == JsRender.NodePropType.LISTENER) {",
697 "\t\t\toffset += 2;",
701 "\tvar ls = _this.file.getLanguageServer();",
703 "\t\t_this.file, line, offset,",
705 "\t\t\tvar res = ls.hover.end(o );",
706 "\t\t\t_this.helper.setHelp(res);",
715 "xtype" : "GestureClick"
720 "(x, y, keyboard_tooltip, tooltip) => {",
722 "\t//GLib.debug(\"query tooltip\");",
723 "\tGtk.TextIter iter;",
726 "\tvar yoff = (int) _this.RightEditor.el.vadjustment.value;",
728 "\t// I think this is problematic - if it's compliing / updating at same time as query.",
730 "\t//if (_this.window.statusbar_compile_spinner.el.spinning) {",
731 "\t//\treturn false;",
734 "\tthis.el.get_iter_at_position (out iter, out trailing, x, y + yoff);",
736 "\tvar l = iter.get_line();",
740 "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
746 "\tif (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {",
747 "\t\tGLib.debug(\"line %d setting tip to %s\", l, _this.buffer.marks.get(l));",
748 "\t\ttooltip.set_text(_this.buffer.marks.get(l).dup());",
756 "\t// this crashes?? - not sure why.",
757 "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
758 "\tif (marks.is_empty()) {",
759 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
761 "\tif (marks.is_empty()) {",
762 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
765 "\t// GLib.debug(\"query tooltip line %d marks %d\", (int)l, (int) marks.length());",
767 "\tmarks.@foreach((m) => { ",
768 "\t\t//GLib.debug(\"got mark %s\", m.name);",
769 "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.category + \": \" + m.name;",
771 "\t// true if there is a mark..",
772 "\tif (str.length > 0 ) {",
773 "\t\ttooltip.set_text( str );",
775 "\treturn str.length > 0 ? true : false;",
781 "string name" : "editor-view",
782 "uint tab_width" : 4,
787 "// show the help page for the active node..",
788 " //this.get('/Help').show();",
790 " // this.get('/BottomPane').el.set_current_page(0);",
791 " \tGLib.debug(\"load called - Reset undo buffer\");",
793 " var buf = (GtkSource.Buffer)this.el.get_buffer();",
794 " buf.begin_irreversible_action();",
795 " buf.set_text(str, str.length);",
796 " buf.end_irreversible_action();",
798 " var lm = GtkSource.LanguageManager.get_default();",
799 " var lang = \"vala\";",
800 " if (_this.file != null) {",
801 " lang = _this.file.language;",
803 " print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);",
804 " var lg = _this.file.content_type.length > 0 ?",
805 " lm.guess_language(_this.file.path, _this.file.content_type) :",
806 " lm.get_language(lang);",
809 " ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg); ",
811 " this.el.insert_spaces_instead_of_tabs = true;",
812 " if (lg != null) {",
813 "\t\tprint(\"sourcelanguage = %s\\n\", lg.name);",
814 "\t\tif (lg.name == \"Vala\") {",
815 "\t\t this.el.insert_spaces_instead_of_tabs = false;",
818 " _this.dirty = false;",
819 " this.el.grab_focus();",
820 " _this.save_button.el.sensitive = false;",
821 " _this.last_error_counter = -1;",
826 "xtype" : "ScrolledWindow"
831 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
832 "bool homogeneous" : false,
833 "bool vexpand" : false,
838 "Gtk.CssProvider css" : "",
839 "bool hexpand" : true,
840 "id" : "search_entry",
846 "(keyval, keycode, state) => {",
848 "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
849 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
850 "\t\t_this.forwardSearch(true);",
855 " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
856 "\t\t_this.forwardSearch(true);",
862 " // print(event.key.keyval)",
869 "xtype" : "EventControllerKey"
876 "_this.search(_this.search_entry.el.text);",
877 "\t _this.search_results.updateResults();",
879 "\tGLib.Timeout.add_seconds(1,() => {",
880 "\t\t _this.search_results.updateResults();",
881 "\t\t return false;",
887 "string name" : "editor-search-entry",
888 "string placeholder_text" : "Press enter to search",
889 "uint search_delay" : 3,
890 "xtype" : "SearchEntry",
891 "| void forwardSearch" : [
892 "(bool change_focus) {",
895 "\t_this.forwardSearch(change_focus);",
899 "\tswitch(_this.windowstate.state) {",
900 "\t\tcase WindowState.State.CODEONLY:",
901 "\t\t//case WindowState.State.CODE:",
902 "\t\t\t// search the code being edited..",
903 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
906 "\t\tcase WindowState.State.PREVIEW:",
907 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
908 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
910 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
923 "id" : "search_results",
924 "int margin_end" : 4,
925 "int margin_start" : 4,
926 "string label" : "No Results",
928 "| void updateResults" : [
930 "\tthis.el.visible = true;",
932 "\tvar res = _this.searchcontext.get_occurrences_count();",
934 "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
938 "\t_this.nextBtn.el.sensitive = false;",
939 "\t_this.backBtn.el.sensitive = false;\t",
942 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
943 "\t\t_this.nextBtn.el.sensitive = true;",
944 "\t\t_this.backBtn.el.sensitive = true;",
947 "\t_this.search_results.el.label = \"No Matches\";",
954 "bool always_show_image" : true,
955 "bool sensitive" : false,
961 "\t_this.forwardSearch(true);",
968 "string icon_name" : "go-down",
973 "bool always_show_image" : true,
974 "bool sensitive" : false,
980 "\t_this.backSearch(true);",
986 "string icon_name" : "go-up",
991 "bool always_show_arrow" : true,
992 "bool always_show_image" : true,
996 "* prop" : "popover",
997 "id" : "search_settings",
1002 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1009 "\tthis.el.show();",
1013 "id" : "case_sensitive",
1014 "string label" : "Case Sensitive",
1015 "xtype" : "CheckButton"
1021 "\tthis.el.show();",
1026 "string label" : "Regex",
1027 "xtype" : "CheckButton"
1032 "string label" : "Multi-line (add \\n)",
1033 "xtype" : "CheckButton"
1042 "string icon_name" : "emblem-system",
1043 "xtype" : "MenuButton"
1053 "* prop" : "end_child",
1054 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1055 "bool hexpand" : true,
1056 "bool vexpand" : true,
1061 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1067 "bool hexpand" : true,
1068 "bool vexpand" : true,
1069 "bool visible" : false,
1070 "id" : "navigationwindow",
1073 "# int last_selected_line" : "-1",
1074 "$ Gtk.Widget? selected_row" : "null",
1077 "id" : "navigation",
1081 "bool expand" : true,
1085 "* prop" : "factory",
1090 "\t// GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1092 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1093 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1096 "\tvar hbox = (Gtk.Box) expand.child;",
1099 "\tvar img = (Gtk.Image) hbox.get_first_child();",
1100 "\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1102 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1103 "\tvar sym = (Lsp.DocumentSymbol) lr.get_item();",
1105 "\tsym.set_data<Gtk.Widget>(\"widget\", expand.get_parent());",
1106 "\texpand.get_parent().get_parent().set_data<Lsp.DocumentSymbol>(\"symbol\", sym);",
1108 "\t//GLib.debug(\"save sym on %s\", expand.get_parent().get_parent().get_type().name());",
1110 "\t//GLib.debug(\"got %d children for %s\" , (int)sym.children.get_n_items(), sym.name);",
1112 " expand.set_hide_expander( sym.children.get_n_items() < 1);",
1113 " \texpand.set_list_row(lr);",
1114 " \t//this.in_bind = true;",
1115 " \t// default is to expand",
1117 " \t//this.in_bind = false;",
1119 " \tsym.bind_property(\"symbol_icon\",",
1120 " img, \"icon_name\",",
1121 " GLib.BindingFlags.SYNC_CREATE);",
1123 " \thbox.css_classes = { sym.symbol_icon };",
1125 " \tsym.bind_property(\"name\",",
1127 " GLib.BindingFlags.SYNC_CREATE);",
1128 " \t// should be better?- --line no?",
1129 " \tsym.bind_property(\"tooltip\",",
1130 " lbl, \"tooltip_markup\",",
1131 " GLib.BindingFlags.SYNC_CREATE);",
1132 " \t// bind image...",
1140 "\tvar expand = new Gtk.TreeExpander();",
1142 "\texpand.set_indent_for_depth(true);",
1143 "\texpand.set_indent_for_icon(true);",
1144 "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1145 "\tvar icon = new Gtk.Image();",
1146 "\tvar lbl = new Gtk.Label(\"\");",
1147 "\tlbl.use_markup = true;",
1148 "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
1150 "\ticon.margin_end = 4;",
1151 " \tlbl.justify = Gtk.Justification.LEFT;",
1152 " \tlbl.xalign = 0;",
1154 "//\tlistitem.activatable = true; ??",
1156 "\thbox.append(icon);",
1157 "\thbox.append(lbl);",
1158 "\texpand.set_child(hbox);",
1159 "\t((Gtk.ListItem)listitem).set_child(expand);",
1165 "xtype" : "SignalListItemFactory"
1168 "string title" : "Code Navigation",
1169 "xtype" : "ColumnViewColumn"
1174 "id" : "navigationselmodel",
1179 "id" : "navigationsort",
1182 "$ Gtk.TreeListModelCreateModelFunc create_func" : [
1185 "\treturn ((Lsp.DocumentSymbol)item).children;",
1191 "bool autoexpand" : true,
1192 "bool passthrough" : false,
1195 "$ GLib.Type item_type" : "typeof(Lsp.DocumentSymbol)",
1198 "id" : "navliststore",
1199 "xtype" : "ListStore",
1200 "| Lsp.DocumentSymbol? symbolAtLine" : [
1201 "(uint line, uint chr) {",
1204 "\tfor(var i = 0; i < this.el.get_n_items();i++) {",
1205 "\t\tvar el = (Lsp.DocumentSymbol)this.el.get_item(i);",
1206 "\t\t//GLib.debug(\"Check sym %s : %d-%d\",",
1207 "\t\t//\tel.name , (int)el.range.start.line,",
1208 "\t\t//\t(int)el.range.end.line",
1210 "\t\tvar ret = el.containsLine(line,chr);",
1211 "\t\tif (ret != null) {",
1212 "\t\t\treturn ret;",
1224 "(position, removed, added) => {",
1225 "\tGLib.debug(\"tree item changed %d , %d , %d\",(int) position, (int)removed, (int) added);",
1226 "\t if (added < 1) { ",
1229 "\t//var sym = (Lsp.DocumentSymbol) this.el.get_item(position);",
1230 "\tvar row = this.el.get_row(position);",
1232 "\tGLib.debug(\"got %s\", row.get_item().get_type().name());",
1239 "xtype" : "TreeListModel"
1243 "* prop" : "sorter",
1247 "* prop" : "sorter",
1250 "$ GLib.Type this_type" : "typeof(Lsp.DocumentSymbol)",
1252 "* prop" : "expression",
1253 "string property_name" : "sort_key",
1254 "xtype" : "PropertyExpression"
1257 "xtype" : "StringSorter"
1260 "xtype" : "TreeListRowSorter"
1263 "xtype" : "SortListModel",
1264 "| Lsp.DocumentSymbol? getSymbolAt" : [
1267 " var tr = (Gtk.TreeListRow)this.el.get_item(row);",
1269 " var a = tr.get_item();; ",
1270 " GLib.debug(\"get_item (2) = %s\", a.get_type().name());",
1273 " return (Lsp.DocumentSymbol)tr.get_item();",
1277 "| int getRowFromSymbol" : [
1278 "(Lsp.DocumentSymbol sym) {",
1280 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1281 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1283 "\t\tif (sym.equals( (Lsp.DocumentSymbol)tr.get_item())) {",
1290 "| void collapseOnLoad" : [
1292 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1293 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1294 "\t\tvar sym = (Lsp.DocumentSymbol)tr.get_item();",
1295 "\t\tswitch (sym.kind) {",
1296 "\t \t\tcase Lsp.SymbolKind.Enum: ",
1297 "\t \t\t\ttr.expanded = false;",
1300 "\t\t\t\t//tr.expanded = true;",
1312 "xtype" : "NoSelection"
1318 "(n_press, x, y) => {",
1320 " \tvar row = _this.navigation.getRowWidgetAt(x,y, out pos );",
1322 " if (row == null) {",
1323 "\t GLib.debug(\"no row selected items\");",
1326 "\tGLib.debug(\"got click on %s\", row.get_type().name()); ",
1327 " //Lsp.DocumentSymbol",
1328 " var sym = row.get_data<Lsp.DocumentSymbol>(\"symbol\");",
1329 " if (sym == null) {",
1335 " \"line\" : 1410,",
1336 " \"character\" : 8",
1339 " \"line\" : 1410,",
1340 " \"character\" : 39",
1344 " GLib.debug(\"goto line %d\", (int)sym.range.start.line); ",
1345 " _this.scroll_to_line((int)sym.range.start.line);",
1346 " Gtk.TextIter iter;",
1347 " _this.buffer.el.get_iter_at_line_offset(out iter, ",
1348 " \t(int)sym.range.start.line,",
1349 " \t(int)sym.range.start.character",
1351 " _this.buffer.el.place_cursor(iter);",
1356 "xtype" : "GestureClick"
1359 "string name" : "editor-navigation",
1360 "xtype" : "ColumnView",
1361 "| Gtk.Widget? getRowWidgetAt" : [
1362 "(double x, double y, out string pos) {",
1365 "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1366 "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1367 "\tif (w == null) {",
1371 "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1372 "\tif (row == null) {",
1376 "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1380 "\t//GLib.debug(\"row number is %d\", rn);",
1381 "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1382 "\t// above or belw",
1383 "\tGraphene.Rect bounds;",
1384 "\trow.compute_bounds(this.el, out bounds);",
1385 "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1386 "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1387 "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1389 "\tvar ypos = y - bounds.get_y();",
1390 "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1391 "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1392 "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1393 "\tpos = \"over\";",
1395 "\tif (rpos > 80) {",
1396 "\t\tpos = \"below\";",
1397 "\t} else if (rpos < 20) {",
1398 "\t\tpos = \"above\";",
1403 "| int getRowAt" : [
1404 "(double x, double y, out string pos) {",
1407 "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1408 "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1409 "\tif (w == null) {",
1413 "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1414 "\tif (row == null) {",
1418 "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1423 "\twhile (cr.get_prev_sibling() != null) {",
1425 "\t\tcr = cr.get_prev_sibling();",
1428 "\t//GLib.debug(\"row number is %d\", rn);",
1429 "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1430 "\t// above or belw",
1431 "\tGraphene.Rect bounds;",
1432 "\trow.compute_bounds(this.el, out bounds);",
1433 "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1434 "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1435 "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1437 "\tvar ypos = y - bounds.get_y();",
1438 "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1439 "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1440 "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1441 "\tpos = \"over\";",
1443 "\tif (rpos > 80) {",
1444 "\t\tpos = \"below\";",
1445 "\t} else if (rpos < 20) {",
1446 "\t\tpos = \"above\";",
1452 "(Gee.ArrayList<Lsp.DocumentSymbol> syms) {",
1453 "\t_this.navigationwindow.el.show();",
1454 "\t//_this.navliststore.el.remove_all();",
1457 "\tvar ls = new GLib.ListStore(typeof(Lsp.DocumentSymbol));",
1459 "\tforeach(var sym in syms) {",
1460 "\t\tls.append(sym);",
1462 "\tLsp.DocumentSymbol.copyList(ls, _this.navliststore.el);",
1463 "\t//_this.navliststore.el.append(sym);",
1464 "\tthis.last_selected_line = -1;",
1465 "\tGLib.Idle.add(() => {",
1466 "\t\t_this.navigationsort.collapseOnLoad();",
1467 "\t\tGtk.TextIter iter;",
1468 "\t\t_this.buffer.el.get_iter_at_offset (",
1469 "\t\t\t\tout iter, _this.buffer.el.cursor_position);",
1471 "\t\tGLib.debug(\"idle update scroll %d, %d\", iter.get_line(),",
1472 "\t\t\t\titer.get_line_offset());",
1473 "\t\tthis.updateSelectedLine(",
1474 "\t\t\t\t(uint)iter.get_line(),",
1475 "\t\t\t\t(uint)iter.get_line_offset()",
1477 "\t\treturn false;",
1482 "| void updateSelectedLine" : [
1483 "(uint line, uint chr) {",
1484 "\tif (line == this.last_selected_line) {",
1487 "\tGLib.debug(\"select line %d\", (int)line);",
1488 "\tthis.last_selected_line = (int)line;",
1491 "\tvar new_row = -1;",
1492 "\tvar sym = _this.navliststore.symbolAtLine(line, chr);",
1493 "\tif (sym != null) {",
1494 "\t \tnew_row = _this.navigationsort.getRowFromSymbol(sym);",
1495 " \t\tGLib.debug(\"select line %d - row found %d\", (int)line, new_row);",
1497 " \t\tGLib.debug(\" no symbol found at line %d\", (int)line);",
1500 "\tif (this.selected_row != null) { ",
1501 "\t\tGLib.debug(\" remove selected row\");",
1502 "\t\tthis.selected_row.remove_css_class(\"selected-row\");",
1504 "\tthis.selected_row = null;",
1505 "\tif (new_row > -1) {",
1506 "\t\tthis.el.scroll_to(new_row,null,Gtk.ListScrollFlags.NONE, null);",
1507 "\t\tvar row = sym.get_data<Gtk.Widget>(\"widget\");",
1508 "\t\tif (row != null) {",
1509 "\t\t\tGLib.debug(\" Add selected row\");",
1511 "\t\t\trow.add_css_class(\"selected-row\");",
1512 "\t\t\tthis.selected_row = row;",
1516 "\t\t\tGLib.debug(\"could not find widget on row %d\", new_row);",
1526 "xtype" : "ScrolledWindow"
1536 "| bool saveContents" : [
1540 " if (_this.file == null) {",
1546 " var str = _this.buffer.toString();",
1548 " _this.buffer.checkSyntax();",
1552 " // LeftPanel.model.changed( str , false);",
1553 " _this.dirty = false;",
1554 " _this.save_button.el.sensitive = false;",
1556 " // find the text for the node..",
1557 " if (_this.file.xtype != \"PlainFile\") {",
1558 " // in theory these properties have to exist!?!",
1559 " \tthis.prop.val = str;",
1560 " //this.window.windowstate.left_props.reload();",
1562 " _this.file.setSource( str );",
1565 " // call the signal..",
1573 "(string in_txt) {",
1575 "\tvar s = new GtkSource.SearchSettings();",
1576 "\ts.case_sensitive = _this.case_sensitive.el.active;",
1577 "\ts.regex_enabled = _this.regex.el.active;\t",
1578 "\ts.wrap_around = false;",
1580 "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
1581 "\tthis.searchcontext.set_highlight(true);",
1582 "\tvar txt = in_txt;",
1584 "\tif (_this.multiline.el.active) {",
1585 "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
1588 "\ts.set_search_text(txt);",
1589 "\tGtk.TextIter beg, st,en;",
1591 "\tthis.buffer.el.get_start_iter(out beg);",
1592 "\tbool has_wrapped_around;",
1593 "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
1594 "\tthis.last_search_end = 0;",
1596 "\treturn this.searchcontext.get_occurrences_count();",
1604 "| string tempFileContents" : [
1608 " if (_this.file == null) {",
1611 "\tvar str= this.buffer.toString();",
1612 "\tif (_this.file.xtype == \"PlainFile\") {",
1620 " GLib.debug(\"calling validate\"); ",
1621 " // clear the buttons.",
1622 " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
1623 "\t\treturn this.file.toSource(); ;",
1626 "\tvar oldcode = _this.prop.val;",
1627 "\t_this.prop.val = str;",
1628 " var ret = _this.file.toSource();",
1629 " _this.prop.val = oldcode;",
1634 "| void backSearch" : [
1635 "(bool change_focus) {",
1637 "\tif (this.searchcontext == null) {",
1641 "\tGtk.TextIter beg, st,en;",
1642 "\tbool has_wrapped_around;",
1643 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
1645 "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
1646 "\t\tthis.last_search_end = 0;",
1648 "\t\tthis.last_search_end = en.get_offset();",
1649 "\t\tif (change_focus) {",
1650 "\t\t\tthis.view.el.grab_focus();",
1652 "\t\tthis.buffer.el.place_cursor(st);",
1653 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
1659 "| void forwardSearch" : [
1660 "(bool change_focus) {",
1662 "\tif (this.searchcontext == null) {",
1666 "\tGtk.TextIter beg, st,en;",
1667 "\t bool has_wrapped_around;",
1668 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);",
1669 "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
1671 "\t\tthis.last_search_end = 0; // not sure if this should happen",
1673 "\t\tif (has_wrapped_around) {",
1677 "\t\tthis.last_search_end = en.get_offset();",
1678 "\t\tif (change_focus) {",
1679 "\t\t\tthis.view.el.grab_focus();",
1681 "\t\tthis.buffer.el.place_cursor(st);",
1682 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
1690 "\t this.file = null; ",
1692 " this.node = null;",
1693 " this.prop = null;",
1694 "\tthis.searchcontext = null;",
1699 "| void scroll_to_line" : [
1702 "\tGLib.Timeout.add(500, () => {",
1704 "\t\tvar buf = this.view.el.get_buffer();",
1706 "\t\tvar sbuf = (GtkSource.Buffer) buf;",
1709 "\t\tGtk.TextIter iter; ",
1710 "\t\tsbuf.get_iter_at_line(out iter, line);",
1711 "\t\tthis.view.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
1712 "\t\treturn false;",
1718 "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)",
1721 " if (this.file != null) {",
1722 " \tthis.file.navigation_tree_updated.disconnect(",
1723 " \t\t_this.navigation.show",
1726 " this.file = file; ",
1727 " this.file.navigation_tree_updated.connect(",
1728 "\t\t_this.navigation.show",
1730 " if (file.xtype != \"PlainFile\") {",
1731 " \tthis.prop = prop;",
1732 " this.node = node;",
1734 " // find the text for the node..",
1735 " this.view.load( prop.val );",
1736 " this.updateErrorMarks();",
1740 " this.close_btn.el.show(); ",
1743 " this.view.load( file.toSource() );",
1744 " this.updateErrorMarks();",
1745 " this.close_btn.el.hide();",
1746 " var ls = file.getLanguageServer();",
1747 " ls.queueDocumentSymbols(file);",
1748 " ////ls.documentSymbols.begin(file, (a,o) => {",
1749 " //\t_this.navigation.show(ls.documentSymbols.end(o)); ",
1751 " //documentSymbols",
1757 "| void updateErrorMarks" : [
1762 "\tvar buf = _this.buffer.el;",
1763 "\tGtk.TextIter start;",
1764 "\tGtk.TextIter end; ",
1765 "\tbuf.get_bounds (out start, out end);",
1770 "\t//GLib.debug(\"highlight errors\");\t\t ",
1772 "\t // we should highlight other types of errors..",
1774 "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
1776 "\t\t_this.window.windowstate.state != WindowState.State.CODE",
1778 "\t\t//GLib.debug(\"windowstate != CODEONLY?\");",
1784 "\tif (_this.file == null) {",
1785 "\t\tGLib.debug(\"file is null?\");",
1789 "\tvar ar = this.file.getErrors();",
1790 "\tif (ar.size < 1) {",
1791 "\t\tbuf.remove_source_marks (start, end, \"ERR\");",
1792 "\t\tbuf.remove_source_marks (start, end, \"WARN\");",
1793 "\t\tbuf.remove_source_marks (start, end, \"DEPR\");",
1794 "\t\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1795 "\t\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1796 "\t\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1797 "\t\tthis.last_error_counter = file.error_counter ;",
1798 "\t\t//GLib.debug(\"highlight %s : %s has no errors\", this.file.relpath, category);",
1803 " // basicaly check if there is no change, then we do not do any update..",
1804 " // we can do this by just using an error counter?",
1805 " // if that's changed then we will do an update, otherwise dont bother.",
1808 "\tvar offset = 0;",
1809 "\tvar hoffset = 0;",
1811 "\tvar tlines = buf.get_line_count () +1;",
1813 "\tif (_this.prop != null) {",
1814 "\t\t// this still seems flaky...",
1816 "\t\ttlines = _this.prop.end_line;",
1817 "\t\toffset = _this.prop.start_line;",
1818 "\t\thoffset = _this.node.node_pad.length + 2; //shift it left by 2 ? ..",
1822 "\t\t// no update...",
1823 "\t\tif (this.last_error_counter == file.error_counter) {",
1829 "\tbuf.remove_source_marks (start, end, \"ERR\");",
1830 "\tbuf.remove_source_marks (start, end, \"WARN\");",
1831 "\tbuf.remove_source_marks (start, end, \"DEPR\");",
1832 "\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1833 "\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1834 "\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1836 "\tforeach(var diag in ar) { ",
1837 "\t Gtk.TextIter iter;",
1838 "// print(\"get inter\\n\");",
1839 "\t var eline = (int)diag.range.start.line - offset;",
1840 "\t var eline_to = (int)diag.range.end.line - offset;",
1841 "\t //var eline = diag.range.end_line - offset;",
1842 "\t //GLib.debug(\"GOT ERROR on line %d -- converted to %d (offset = %d)\",",
1843 "\t //\terr.line ,eline, offset);",
1846 "\t if (eline > tlines || eline < 0) {",
1850 "\t buf.get_iter_at_line( out iter, eline);",
1851 "\t \tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
1852 "\t buf.create_source_mark( msg, diag.category, iter);",
1854 " \t var spos = (int)diag.range.start.character - hoffset;",
1855 " \t if (spos < 0) { spos =0 ; }",
1856 " \t if (spos > iter.get_chars_in_line()) {",
1857 " \t \tspos = iter.get_chars_in_line();",
1859 "\t\tbuf.get_iter_at_line( out iter, eline_to);",
1860 "\t\tvar epos = (int)diag.range.end.character - hoffset;",
1861 " \t if (epos < 0) { epos =0 ; }",
1862 " \t if (epos > iter.get_chars_in_line()) {",
1863 " \t \tepos = iter.get_chars_in_line();",
1867 " \t buf.get_iter_at_line_offset( out start, eline, spos); ",
1869 " \t buf.get_iter_at_line_offset( out end, eline_to,epos); ",
1871 "\t buf.apply_tag_by_name(diag.category, start, end);",
1873 "\t // GLib.debug(\"set line %d to %s\", eline, msg);",
1874 "\t //this.marks.set(eline, msg);",
1876 "\tthis.last_error_counter = file.error_counter ;",