From 05f0b3c7f23b625137acda0d0f58ab6e2c5d4787 Mon Sep 17 00:00:00 2001 From: Marsh Gardiner Date: Fri, 9 May 2014 12:59:45 -0700 Subject: [PATCH] Isolate float regex matching to 1 char for + and - MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents highlighting on the "2" in "auth: oauth2". (signing CLA and sending in now) Now passes tests and also covers .37 case. … and updated to cover the ++ or -- case. --- lib/ace/mode/yaml_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/yaml_highlight_rules.js b/lib/ace/mode/yaml_highlight_rules.js index 7bd9f453..9fc17f0a 100644 --- a/lib/ace/mode/yaml_highlight_rules.js +++ b/lib/ace/mode/yaml_highlight_rules.js @@ -79,7 +79,7 @@ var YamlHighlightRules = function() { regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "constant.numeric", // float - regex : /[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/ + regex : /(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)/ }, { token : "constant.numeric", // other number regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/