recognize USO vars ending with -rgb

This commit is contained in:
tophf 2017-12-06 06:29:54 +03:00
parent aa44077212
commit 8f9705c165

View File

@ -193,7 +193,8 @@ CodeMirror.hint && (() => {
string[pos - 3] === ']' && string[pos - 3] === ']' &&
string[pos - 4] === ']') { string[pos - 4] === ']') {
const vars = typeof editor !== 'undefined' && (editor.getStyle().usercssData || {}).vars; const vars = typeof editor !== 'undefined' && (editor.getStyle().usercssData || {}).vars;
if (vars && Object.hasOwnProperty.call(vars, string.slice(start + 4, pos - 4))) { const name = vars && string.slice(start + 4, pos - 4);
if (vars && Object.hasOwnProperty.call(vars, name.endsWith('-rgb') ? name.slice(0, -4) : name)) {
token[0] = USO_VALID_VAR; token[0] = USO_VALID_VAR;
} else { } else {
token[0] = USO_INVALID_VAR; token[0] = USO_INVALID_VAR;