From 068f23b029e2e3a04e9f6769c562545d7ab63c2f Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 22 Dec 2017 16:29:52 +0300 Subject: [PATCH] fixup: include -+, exclude whitespace at line start --- edit/codemirror-default.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index 703e2ac1..7e9700e2 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -173,14 +173,14 @@ const isCss = type && !/^(comment|string)/.test(type); const isNumber = type === 'number'; - let wordChars = isNumber ? /[\w.]/uy : isCss ? /[-#\w!]/uy : /[#\w]/uy; + let wordChars = isNumber ? /[-+\w.]/uy : isCss ? /[-#\w!]/uy : /[#\w]/uy; let {ch} = pos; let i = ch; while (i >= 0) { wordChars.lastIndex = i--; if (!wordChars.test(text)) break; } - i += !i ? 0 : i < 0 || isCss && /^qualifier/.test(type) && text[i + 1] === '.' ? 1 : 2; + i += !i ? 0 : isCss && /^qualifier/.test(type) && text[i + 1] === '.' ? 1 : 2; let j; if (isNumber) {