2 "build_module" : "builder",
5 "# GtkSource.SearchContext searchcontext" : "null",
6 "# JsRender.JsRender? file" : "null",
7 "# JsRender.Node node" : "null",
8 "# JsRender.NodeProp? prop" : "null",
9 "# Xcls_MainWindow window" : "null",
10 "# bool dirty" : false,
12 "# int pos_root_x" : "",
13 "# int pos_root_y" : "",
14 "# string activeEditor" : "\"\"",
15 "$ homogeneous" : false,
18 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
19 "bool hexpand" : true,
20 "bool vexpand" : true,
21 "int last_search_end" : 0,
24 "$ homogeneous" : false,
26 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
27 "bool hexpand" : true,
36 " _this.saveContents();",
45 "bool hexpand" : true,
50 "* ctor" : "new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1)",
53 "\tthis.el.set_range(6,30);",
54 "\tthis.el.set_value(8);",
58 "bool draw_value" : false,
59 "bool has_origin" : true,
60 "bool sensitive" : true,
62 "int width_request" : 200,
68 "\t _this.view.css.load_from_string(",
69 "\t \t\t\"#editor-view { font: %dpx monospace; }\".printf((int)val)",
85 "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
86 "string icon_name" : "window-close",
93 " _this.saveContents();",
94 " _this.window.windowstate.switchState(WindowState.State.PREVIEW);",
99 "string icon_name" : "window-close",
107 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
108 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
109 "bool overlay_scrolling" : false,
110 "bool vexpand" : true,
111 "id" : "RightEditor",
114 "# Gtk.CssProvider css" : "null",
115 "$ gboolean auto_indent" : true,
116 "$ xns" : "GtkSource",
120 "this.css = new Gtk.CssProvider();",
122 "this.css.load_from_string(",
123 "\t\"#editor-view { font: 12px monospace;}\"",
126 "Gtk.StyleContext.add_provider_for_display(",
127 "\tthis.el.get_display(),",
129 "\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
135 "this is pretty flakey - triggers Gtk with < 0 d",
136 " var cp = new GtkSource.CompletionWords(\"test\"); ",
137 " cp.minimum_word_size = 3;",
138 " //cp.priority = 100; //?? does this do anything",
139 " cp.proposals_batch_size = 10;",
140 " cp.scan_batch_size = 1000;",
142 "cp.register(_this.buffer.el);",
143 "this.el.completion.add_provider(cp);",
145 "this.el.completion.add_provider(new Palete.CompletionProvider(_this));",
147 "//this.el.completion.unblock_interactive();",
148 "this.el.completion.select_on_show = true; // select",
149 "//this.el.completion.remember_info_visibility\t = true;",
152 "var attrs = new GtkSource.MarkAttributes();",
153 "var pink = Gdk.RGBA();",
154 "pink.parse ( \"pink\");",
155 "attrs.set_background ( pink);",
156 "attrs.set_icon_name ( \"process-stop\"); ",
157 "attrs.query_tooltip_text.connect(( mark) => {",
158 " GLib.debug(\"tooltip query? %s\", mark.name);",
159 " return strdup( mark.name);",
161 " attrs.query_tooltip_markup.connect(( mark) => {",
162 " GLib.debug(\"tooltip query? %s\", mark.name);",
163 " return strdup( mark.name);",
165 "this.el.set_mark_attributes (\"ERR\", attrs, 1);",
167 " var wattrs = new GtkSource.MarkAttributes();",
168 "var blue = Gdk.RGBA();",
169 "blue.parse ( \"#ABF4EB\");",
170 "wattrs.set_background ( blue);",
171 "wattrs.set_icon_name ( \"process-stop\"); ",
172 "wattrs.query_tooltip_text.connect(( mark) => {",
173 " GLib.debug(\"tooltip query? %s\", mark.name);",
174 " return strdup(mark.name);",
176 "wattrs.query_tooltip_markup.connect(( mark) => {",
177 " GLib.debug(\"tooltip query? %s\", mark.name);",
178 " return strdup(mark.name);",
180 "this.el.set_mark_attributes (\"WARN\", wattrs, 1);",
184 " var dattrs = new GtkSource.MarkAttributes();",
185 "var purple = Gdk.RGBA();",
186 "purple.parse ( \"#EEA9FF\");",
187 "dattrs.set_background ( purple);",
188 "dattrs.set_icon_name ( \"process-stop\"); ",
189 "dattrs.query_tooltip_text.connect(( mark) => {",
190 "\tGLib.debug(\"tooltip query? %s\", mark.name);",
191 " return strdup(mark.name);",
193 "dattrs.query_tooltip_markup.connect(( mark) => {",
194 "\tGLib.debug(\"tooltip query? %s\", mark.name);",
195 " return strdup(mark.name);",
197 "this.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
200 " this.el.get_space_drawer().set_matrix(null);",
201 " this.el.get_space_drawer().set_types_for_locations( ",
202 "\tGtkSource.SpaceLocationFlags.ALL,",
203 "\tGtkSource.SpaceTypeFlags.ALL",
205 "this.el.get_space_drawer().set_enable_matrix(true);",
207 "Gtk.SourceDrawSpacesFlags.LEADING + ",
208 "Gtk.SourceDrawSpacesFlags.TRAILING + ",
209 "Gtk.SourceDrawSpacesFlags.TAB + ",
210 "Gtk.SourceDrawSpacesFlags.SPACE",
214 "bool has_tooltip" : true,
215 "bool hexpand" : true,
216 "bool insert_spaces_instead_of_tabs" : true,
217 "bool vexpand" : true,
218 "boolean show_line_marks" : true,
219 "boolean show_line_numbers" : true,
220 "gboolean highlight_current_line" : true,
225 "$ Gee.HashMap<int,string>? xmarks" : "null",
226 "$ xns" : "GtkSource",
227 "$ xtype" : "Buffer",
229 "bool check_queued" : false,
230 "bool enable_undo" : true,
232 "int error_line" : "-1",
236 " // check syntax??",
238 " _this.save_button.el.sensitive = true;",
239 " print(\"EDITOR CHANGED\");",
240 " this.checkSyntax();",
242 " _this.dirty = true;",
244 " // this.get('/LeftPanel.model').changed( str , false);",
250 "| bool checkSyntax" : [
254 " var str = this.toString();",
257 " if (this.error_line > 0) {",
258 " Gtk.TextIter start;",
259 " Gtk.TextIter end; ",
260 " this.el.get_bounds (out start, out end);",
262 " this.el.remove_source_marks (start, end, null);",
264 " if (str.length < 1) {",
265 " print(\"checkSyntax - empty string?\\n\");",
269 " // bit presumptiona",
270 " if (_this.file.xtype == \"PlainFile\") {",
272 " // assume it's gtk...",
273 " var oldcode =_this.file.toSource();",
274 " _this.file.setSource(str);",
275 " _this.file.getLanguageServer().document_change(_this.file);",
276 " _this.file.setSource(oldcode);",
282 " if (_this.file == null) {",
290 " GLib.debug(\"calling validate\"); ",
291 " // clear the buttons.",
292 " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
295 "\tvar oldcode = _this.prop.val;",
297 "\t_this.prop.val = str;",
298 " _this.file.getLanguageServer().document_change(_this.file);",
299 " _this.prop.val = oldcode;",
302 " //print(\"done mark line\\n\");",
304 " return true; // at present allow saving - even if it's invalid..",
308 "| bool highlightErrors" : [
309 "( Gee.HashMap<int,string> validate_res) {",
311 "\tthis.error_line = validate_res.size;",
313 "\tif (this.error_line < 1) {",
316 "\tvar tlines = this.el.get_line_count ();",
317 "\tGtk.TextIter iter;",
318 "\tvar valiter = validate_res.map_iterator();",
319 "\twhile (valiter.next()) {",
321 "\t// print(\"get inter\\n\");",
322 "\t\tvar eline = valiter.get_key();",
323 "\t\tif (eline > tlines) {",
326 "\t\tthis.el.get_iter_at_line( out iter, eline);",
327 "\t\t//print(\"mark line\\n\");",
328 "\t\tthis.el.create_source_mark(valiter.get_value(), \"ERR\", iter);",
333 "| bool highlightErrorsJson" : [
334 "(string type, Json.Object obj) {",
335 "\tGtk.TextIter start;",
336 "\tGtk.TextIter end; ",
337 "\tthis.el.get_bounds (out start, out end);",
339 "\tthis.el.remove_source_marks (start, end, type);",
340 "\tGLib.debug(\"highlight errors\");\t\t ",
342 "\t // we should highlight other types of errors..",
344 "\tif (!obj.has_member(type)) {",
345 "\t\tGLib.debug(\"Return has no errors\\n\");",
349 "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
351 "\t\t_this.window.windowstate.state != WindowState.State.CODE",
353 "\t\tGLib.debug(\"windowstate != CODEONLY?\");",
358 "\t//this.marks = new Gee.HashMap<int,string>();",
359 "\tvar err = obj.get_object_member(type);",
361 "\tif (_this.file == null) {",
362 "\t\tGLib.debug(\"file is null?\");",
366 "\tvar valafn = _this.file.path;",
368 "\tif (_this.file.xtype != \"PlainFile\") {",
370 "\t\tvalafn = \"\";",
372 "\t\t\tvar regex = new Regex(\"\\\\.bjs$\");",
373 "\t\t\t// should not happen",
374 "\t \t\tvalafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
375 "\t\t} catch (GLib.RegexError e) {",
376 "\t\t\treturn true;",
382 "\tif (!err.has_member(valafn)) {",
383 "\t\tGLib.debug(\"File path has no errors\");",
387 "\tvar lines = err.get_object_member(valafn);",
390 "\tif (obj.has_member(\"line_offset\")) { // ?? why??",
391 "\t\toffset = (int)obj.get_int_member(\"line_offset\") + 1;",
395 "\tvar tlines = this.el.get_line_count () +1;",
397 "\tif (_this.prop != null) {",
399 "\t\ttlines = _this.prop.end_line + 1;",
400 "\t\toffset = _this.prop.start_line + 1;",
406 "\tlines.foreach_member((obj, line, node) => {",
408 "\t Gtk.TextIter iter;",
409 "// print(\"get inter\\n\");",
410 "\t var eline = int.parse(line) - offset;",
411 "\t GLib.debug(\"GOT ERROR on line %s -- converted to %d (offset = %d)\\n\", line,eline, offset);",
414 "\t if (eline > tlines || eline < 0) {",
419 "\t this.el.get_iter_at_line( out iter, eline);",
420 "\t //print(\"mark line\\n\");",
421 "\t var msg = \"\";",
422 "\t var ar = lines.get_array_member(line);",
423 "\t for (var i = 0 ; i < ar.get_length(); i++) {",
424 "\t \tif (ar.get_string_element(i) == \"Success\") {",
427 "\t\t\tmsg += (msg.length > 0) ? \"\\n\" : \"\";",
428 "\t\t\tmsg += ar.get_string_element(i);",
430 "\t\tif (msg == \"\") {",
433 "\t\tmsg = \"Line: %d\".printf(eline+1) + \" \" + msg;",
434 "\t this.el.create_source_mark(msg, type, iter);",
435 "\t GLib.debug(\"set line %d to %m\", eline, msg);",
436 "\t // this.marks.set(eline, msg);",
447 "| string toString" : [
452 " this.el.get_start_iter(out s);",
453 " this.el.get_end_iter(out e);",
454 " var ret = this.el.get_text(s,e,true);",
455 " //print(\"TO STRING? \" + ret);",
465 "(keyval, keycode, state) => {",
468 " if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
469 " GLib.debug(\"SAVE: ctrl-S pressed\");",
470 " _this.saveContents();",
474 " if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
475 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
476 "\t\t_this.forwardSearch(true);",
479 "\tif (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
480 "\t GLib.debug(\"SAVE: ctrl-f pressed\");",
481 "\t\t_this.search_entry.el.grab_focus();",
484 " //_this.view.el.show_completion();",
485 " // print(event.key.keyval)",
494 "xtype" : "EventControllerKey"
499 "(x, y, keyboard_tooltip, tooltip) => {",
501 "\t//GLib.debug(\"query tooltip\");",
502 "\tGtk.TextIter iter;",
505 "\tvar yoff = (int) _this.RightEditor.el.vadjustment.value;",
507 "\t// I think this is problematic - if it's compliing / updating at same time as query.",
509 "\t//if (_this.window.statusbar_compile_spinner.el.spinning) {",
510 "\t//\treturn false;",
513 "\tthis.el.get_iter_at_position (out iter, out trailing, x, y + yoff);",
515 "\tvar l = iter.get_line();",
519 "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
525 "\tif (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {",
526 "\t\tGLib.debug(\"line %d setting tip to %s\", l, _this.buffer.marks.get(l));",
527 "\t\ttooltip.set_text(_this.buffer.marks.get(l).dup());",
535 "\t// this crashes?? - not sure why.",
536 "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
537 "\tif (marks.is_empty()) {",
538 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
540 "\tif (marks.is_empty()) {",
541 "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
544 "\t// GLib.debug(\"query tooltip line %d marks %d\", (int)l, (int) marks.length());",
546 "\tmarks.@foreach((m) => { ",
547 "\t\t//GLib.debug(\"got mark %s\", m.name);",
548 "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.category + \": \" + m.name;",
550 "\t// true if there is a mark..",
551 "\tif (str.length > 0 ) {",
552 "\t\ttooltip.set_text( str );",
554 "\treturn str.length > 0 ? true : false;",
560 "string name" : "editor-view",
561 "uint tab_width" : 4,
566 "// show the help page for the active node..",
567 " //this.get('/Help').show();",
569 " // this.get('/BottomPane').el.set_current_page(0);",
570 " \tGLib.debug(\"load called - Reset undo buffer\");",
572 " var buf = (GtkSource.Buffer)this.el.get_buffer();",
573 " buf.begin_irreversible_action();",
574 " buf.set_text(str, str.length);",
575 " buf.end_irreversible_action();",
577 " var lm = GtkSource.LanguageManager.get_default();",
578 " var lang = \"vala\";",
579 " if (_this.file != null) {",
580 " lang = _this.file.language;",
582 " print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);",
583 " var lg = _this.file.content_type.length > 0 ?",
584 " lm.guess_language(_this.file.path, _this.file.content_type) :",
585 " lm.get_language(lang);",
588 " ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg); ",
590 " this.el.insert_spaces_instead_of_tabs = true;",
591 " if (lg != null) {",
592 "\t\tprint(\"sourcelanguage = %s\\n\", lg.name);",
593 "\t\tif (lg.name == \"Vala\") {",
594 "\t\t this.el.insert_spaces_instead_of_tabs = false;",
597 " _this.dirty = false;",
598 " this.el.grab_focus();",
599 " _this.save_button.el.sensitive = false;",
604 "xtype" : "ScrolledWindow"
609 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
610 "bool homogeneous" : false,
611 "bool vexpand" : false,
616 "Gtk.CssProvider css" : "",
617 "bool hexpand" : true,
618 "id" : "search_entry",
624 "(keyval, keycode, state) => {",
626 "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
627 "\t GLib.debug(\"SAVE: ctrl-g pressed\");",
628 "\t\t_this.forwardSearch(true);",
633 " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
634 "\t\t_this.forwardSearch(true);",
640 " // print(event.key.keyval)",
647 "xtype" : "EventControllerKey"
654 "_this.search(_this.search_entry.el.text);",
655 "\t _this.search_results.updateResults();",
657 "\tGLib.Timeout.add_seconds(1,() => {",
658 "\t\t _this.search_results.updateResults();",
659 "\t\t return false;",
665 "string name" : "editor-search-entry",
666 "string placeholder_text" : "Press enter to search",
667 "uint search_delay" : 3,
668 "xtype" : "SearchEntry",
669 "| void forwardSearch" : [
670 "(bool change_focus) {",
673 "\t_this.forwardSearch(change_focus);",
677 "\tswitch(_this.windowstate.state) {",
678 "\t\tcase WindowState.State.CODEONLY:",
679 "\t\t//case WindowState.State.CODE:",
680 "\t\t\t// search the code being edited..",
681 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
684 "\t\tcase WindowState.State.PREVIEW:",
685 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
686 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
688 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
701 "id" : "search_results",
702 "int margin_end" : 4,
703 "int margin_start" : 4,
704 "string label" : "No Results",
706 "| void updateResults" : [
708 "\tthis.el.visible = true;",
710 "\tvar res = _this.searchcontext.get_occurrences_count();",
712 "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
716 "\t_this.nextBtn.el.sensitive = false;",
717 "\t_this.backBtn.el.sensitive = false;\t",
720 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
721 "\t\t_this.nextBtn.el.sensitive = true;",
722 "\t\t_this.backBtn.el.sensitive = true;",
725 "\t_this.search_results.el.label = \"No Matches\";",
732 "bool always_show_image" : true,
733 "bool sensitive" : false,
739 "\t_this.forwardSearch(true);",
746 "string icon_name" : "go-down",
751 "bool always_show_image" : true,
752 "bool sensitive" : false,
758 "\t_this.backSearch(true);",
764 "string icon_name" : "go-up",
769 "bool always_show_arrow" : true,
770 "bool always_show_image" : true,
774 "* prop" : "popover",
775 "id" : "search_settings",
780 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
791 "id" : "case_sensitive",
792 "string label" : "Case Sensitive",
793 "xtype" : "CheckButton"
804 "string label" : "Regex",
805 "xtype" : "CheckButton"
810 "string label" : "Multi-line (add \\n)",
811 "xtype" : "CheckButton"
820 "string icon_name" : "emblem-system",
821 "xtype" : "MenuButton"
828 "| bool saveContents" : [
832 " if (_this.file == null) {",
838 " var str = _this.buffer.toString();",
840 " _this.buffer.checkSyntax();",
844 " // LeftPanel.model.changed( str , false);",
845 " _this.dirty = false;",
846 " _this.save_button.el.sensitive = false;",
848 " // find the text for the node..",
849 " if (_this.file.xtype != \"PlainFile\") {",
850 " // in theory these properties have to exist!?!",
851 " \tthis.prop.val = str;",
852 " //this.window.windowstate.left_props.reload();",
854 " _this.file.setSource( str );",
857 " // call the signal..",
867 "\tvar s = new GtkSource.SearchSettings();",
868 "\ts.case_sensitive = _this.case_sensitive.el.active;",
869 "\ts.regex_enabled = _this.regex.el.active;\t",
870 "\ts.wrap_around = false;",
872 "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
873 "\tthis.searchcontext.set_highlight(true);",
874 "\tvar txt = in_txt;",
876 "\tif (_this.multiline.el.active) {",
877 "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
880 "\ts.set_search_text(txt);",
881 "\tGtk.TextIter beg, st,en;",
883 "\tthis.buffer.el.get_start_iter(out beg);",
884 "\tbool has_wrapped_around;",
885 "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
886 "\tthis.last_search_end = 0;",
888 "\treturn this.searchcontext.get_occurrences_count();",
896 "| void backSearch" : [
897 "(bool change_focus) {",
899 "\tif (this.searchcontext == null) {",
903 "\tGtk.TextIter beg, st,en;",
904 "\tbool has_wrapped_around;",
905 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
907 "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
908 "\t\tthis.last_search_end = 0;",
910 "\t\tthis.last_search_end = en.get_offset();",
911 "\t\tif (change_focus) {",
912 "\t\t\tthis.view.el.grab_focus();",
914 "\t\tthis.buffer.el.place_cursor(st);",
915 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
921 "| void forwardSearch" : [
922 "(bool change_focus) {",
924 "\tif (this.searchcontext == null) {",
928 "\tGtk.TextIter beg, st,en;",
929 "\t bool has_wrapped_around;",
930 "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);",
931 "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
933 "\t\tthis.last_search_end = 0; // not sure if this should happen",
935 "\t\tif (has_wrapped_around) {",
939 "\t\tthis.last_search_end = en.get_offset();",
940 "\t\tif (change_focus) {",
941 "\t\t\tthis.view.el.grab_focus();",
943 "\t\tthis.buffer.el.place_cursor(st);",
944 "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
952 "\t this.file = null; ",
954 " this.node = null;",
955 " this.prop = null;",
956 "\tthis.searchcontext = null;",
961 "| void scroll_to_line" : [
964 "\tGLib.Timeout.add(500, () => {",
966 "\t\tvar buf = this.view.el.get_buffer();",
968 "\t\tvar sbuf = (GtkSource.Buffer) buf;",
971 "\t\tGtk.TextIter iter; ",
972 "\t\tsbuf.get_iter_at_line(out iter, line);",
973 "\t\tthis.view.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
980 "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)",
983 " this.file = file; ",
985 " if (file.xtype != \"PlainFile\") {",
986 " \tthis.prop = prop;",
987 " this.node = node;",
989 " // find the text for the node..",
990 " this.view.load( prop.val );",
993 " this.close_btn.el.show(); ",
996 " this.view.load( file.toSource() );",
997 " this.close_btn.el.hide();",
1002 "| void updateErrorMarks" : [
1003 "(string category) {",
1007 "\tvar buf = _this.buffer.el;",
1008 "\tGtk.TextIter start;",
1009 "\tGtk.TextIter end; ",
1010 "\tbuf.get_bounds (out start, out end);",
1012 "\tbuf.remove_source_marks (start, end, category);",
1014 "\tGLib.debug(\"highlight errors\");\t\t ",
1016 "\t // we should highlight other types of errors..",
1018 "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
1020 "\t\t_this.window.windowstate.state != WindowState.State.CODE",
1022 "\t\tGLib.debug(\"windowstate != CODEONLY?\");",
1028 "\tif (_this.file == null) {",
1029 "\t\tGLib.debug(\"file is null?\");",
1033 "\tvar ar = this.file.getErrors(category);",
1034 "\tif (ar == null || ar.get_n_items() < 1) {",
1035 "\t\tGLib.debug(\"highlight %s : %s has no errors\", this.file.relpath, category);",
1042 "\tvar offset = 0;",
1045 "\tvar tlines = buf.get_line_count () +1;",
1047 "\tif (_this.prop != null) {",
1049 "\t\ttlines = _this.prop.end_line + 1;",
1050 "\t\toffset = _this.prop.start_line + 1;",
1054 "\tfor (var i = 0; i < ar.get_n_items();i++) {",
1055 "\t\tvar err = (Palete.CompileError) ar.get_item(i);",
1057 "\t Gtk.TextIter iter;",
1058 "// print(\"get inter\\n\");",
1059 "\t var eline = err.line - offset;",
1060 "\t GLib.debug(\"GOT ERROR on line %d -- converted to %d (offset = %d)\",",
1061 "\t \terr.line ,eline, offset);",
1064 "\t if (eline > tlines || eline < 0) {",
1069 "\t buf.get_iter_at_line( out iter, eline);",
1072 "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, err.category, err.msg);",
1073 "\t buf.create_source_mark( msg, err.category, iter);",
1074 "\t GLib.debug(\"set line %d to %s\", eline, msg);",
1075 "\t //this.marks.set(eline, msg);",
1090 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/Editor.bjs",