From 8f9705c165be1edce2371e8a0a5d64f6ba06d576 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 6 Dec 2017 06:29:54 +0300 Subject: [PATCH] recognize USO vars ending with -rgb --- edit/codemirror-default.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index f2c2c452..e68d9f35 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -193,7 +193,8 @@ CodeMirror.hint && (() => { string[pos - 3] === ']' && string[pos - 4] === ']') { 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; } else { token[0] = USO_INVALID_VAR;