From 96a066ed6a16d8aa594eb132d365d3fdab58035e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 15 May 2015 17:30:46 +0800 Subject: [PATCH] src/Builder4/Editor.bjs src/Builder4/Editor.vala --- src/Builder4/Editor.bjs | 2 +- src/Builder4/Editor.vala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index 4e2d46a8e..874ab4602 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -84,7 +84,7 @@ "id" : "buffer", "| bool highlightErrors" : "( Gee.HashMap validate_res) {\n this.error_line = validate_res.size;\n\n if (this.error_line < 1) {\n return true;\n }\n var tlines = this.el.get_line_count ();\n Gtk.TextIter iter;\n var valiter = validate_res.map_iterator();\n while (valiter.next()) {\n \n // print(\"get inter\\n\");\n var eline = valiter.get_key();\n if (eline > tlines) {\n continue;\n }\n this.el.get_iter_at_line( out iter, eline);\n //print(\"mark line\\n\");\n this.el.create_source_mark(valiter.get_value(), \"error\", iter);\n } \n return false;\n }", "| string toString" : " () {\n \n Gtk.TextIter s;\n Gtk.TextIter e;\n this.el.get_start_iter(out s);\n this.el.get_end_iter(out e);\n var ret = this.el.get_text(s,e,true);\n //print(\"TO STRING? \" + ret);\n return ret;\n}\n ", - "| bool checkSyntax" : " () {\n \n if (this.check_running) {\n print(\"Check is running\\n\");\n if (this.check_queued) { \n print(\"Check is already queued\");\n return true;\n }\n this.check_queued = true;\n print(\"Adding queued Check \");\n GLib.Timeout.add_seconds(1, () => {\n this.check_queued = false;\n \n this.checkSyntax();\n return false;\n });\n \n\n return true;\n }\n \n \n var p = Palete.factory(_this.file.xtype); \n \n var str = this.toString();\n \n string res = \"\";\n \n if (this.error_line > 0) {\n Gtk.TextIter start;\n Gtk.TextIter end; \n this.el.get_bounds (out start, out end);\n\n this.el.remove_source_marks (start, end, null);\n }\n \n if (str.length < 1) {\n print(\"checkSyntax - empty string?\\n\");\n return true;\n }\n this.check_running = true;\n \n \n if (_this.file.language == \"js\") {\n this.check_running = false;\n print(\"calling validate javascript\\n\"); \n return this.highlightErrors(p.validateJavascript(\n str, \n _this.key, \n _this.ptype,\n _this.file,\n _this.node\n )); \n \n }\n \n \n print(\"calling validate vala\\n\"); \n // clear the buttons.\n _this.window.statusbar_errors.el.hide();\n _this.window.statusbar_errors.el.hide();\n _this.window.statusbar_errors.el.hide();\n \n \n \n p.validateVala(\n str, \n _this.key, \n _this.ptype,\n _this.file,\n _this.node,\n (obj) => {\n this.check_running = false;\n this.highlightErrorsJson(obj); \n \n //var validate_res = p.validateVala.end(res);\n //this.highlightErrors(validate_res);\n\n }\n \n );\n \n \n \n //print(\"done mark line\\n\");\n \n return true; // at present allow saving - even if it's invalid..\n}\n", + "| bool checkSyntax" : " () {\n \n if (this.check_running) {\n print(\"Check is running\\n\");\n if (this.check_queued) { \n print(\"Check is already queued\");\n return true;\n }\n this.check_queued = true;\n print(\"Adding queued Check \");\n GLib.Timeout.add_seconds(1, () => {\n this.check_queued = false;\n \n this.checkSyntax();\n return false;\n });\n \n\n return true;\n }\n \n \n var p = Palete.factory(_this.file.xtype); \n \n var str = this.toString();\n \n string res = \"\";\n \n if (this.error_line > 0) {\n Gtk.TextIter start;\n Gtk.TextIter end; \n this.el.get_bounds (out start, out end);\n\n this.el.remove_source_marks (start, end, null);\n }\n \n if (str.length < 1) {\n print(\"checkSyntax - empty string?\\n\");\n return true;\n }\n this.check_running = true;\n \n \n if (_this.file.language == \"js\") {\n this.check_running = false;\n print(\"calling validate javascript\\n\"); \n return this.highlightErrors(p.validateJavascript(\n str, \n _this.key, \n _this.ptype,\n _this.file,\n _this.node\n )); \n \n }\n \n \n print(\"calling validate vala\\n\"); \n // clear the buttons.\n _this.window.statusbar_errors.el.hide();\n _this.window.statusbar_warnings.el.hide();\n _this.window.statusbar_depricated.el.hide();\n \n \n \n p.validateVala(\n str, \n _this.key, \n _this.ptype,\n _this.file,\n _this.node,\n (obj) => {\n this.check_running = false;\n this.highlightErrorsJson(obj); \n \n //var validate_res = p.validateVala.end(res);\n //this.highlightErrors(validate_res);\n\n }\n \n );\n \n \n \n //print(\"done mark line\\n\");\n \n return true; // at present allow saving - even if it's invalid..\n}\n", "* pack" : "set_buffer", "xtype" : "SourceBuffer", "bool check_running" : false, diff --git a/src/Builder4/Editor.vala b/src/Builder4/Editor.vala index 2a6dccfd0..0cf73cc2b 100644 --- a/src/Builder4/Editor.vala +++ b/src/Builder4/Editor.vala @@ -461,8 +461,8 @@ public class Editor : Object print("calling validate vala\n"); // clear the buttons. _this.window.statusbar_errors.el.hide(); - _this.window.statusbar_errors.el.hide(); - _this.window.statusbar_errors.el.hide(); + _this.window.statusbar_warnings.el.hide(); + _this.window.statusbar_depricated.el.hide(); -- 2.39.2