fixup: include -+, exclude whitespace at line start

This commit is contained in:
tophf 2017-12-22 16:29:52 +03:00
parent bf6b4eda83
commit 068f23b029

View File

@ -173,14 +173,14 @@
const isCss = type && !/^(comment|string)/.test(type); const isCss = type && !/^(comment|string)/.test(type);
const isNumber = type === 'number'; 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 {ch} = pos;
let i = ch; let i = ch;
while (i >= 0) { while (i >= 0) {
wordChars.lastIndex = i--; wordChars.lastIndex = i--;
if (!wordChars.test(text)) break; 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; let j;
if (isNumber) { if (isNumber) {