From e2359b2f9f3c1eb63ac601e25fc26e326488f105 Mon Sep 17 00:00:00 2001 From: DanyaPostfactum Date: Mon, 24 Jun 2013 21:06:32 +1000 Subject: [PATCH] Let JS line comment rules be not greedy --- lib/ace/mode/javascript_highlight_rules.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 3984f2c3..35255c68 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -215,8 +215,8 @@ var JavaScriptHighlightRules = function() { next : "comment_regex_allowed" }, { token : "comment", - regex : "\\/\\/.*$", - next : "start" + regex : "\\/\\/", + next : "line_comment" }, { token: "string.regexp", regex: "\\/", @@ -309,6 +309,10 @@ var JavaScriptHighlightRules = function() { {token : "comment", regex : "\\*\\/", next : "no_regex"}, {defaultToken : "comment"} ], + "line_comment" : [ + {token : "comment", regex : "$", next : "start"}, + {defaultToken : "comment"} + ], "qqstring" : [ { token : "constant.language.escape",