From 7ab0651e4d160b7d896c00bde85b297ab0536448 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 1 May 2020 08:52:18 +0300 Subject: [PATCH] add ":" to prop names in css autocomplete menu (#915) --- edit/codemirror-default.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index 882390d5..3f8afc6d 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -372,7 +372,13 @@ CodeMirror.hint && (() => { } if (!editor || !style || !style.includes(USO_VAR)) { - return originalHelper(cm); + // add ":" after a property name + const res = originalHelper(cm); + const state = res && cm.getTokenAt(pos).state.state; + if (state === 'block' || state === 'maybeprop') { + res.list = res.list.map(str => str + ': '); + } + return res; } // USO vars in usercss mode editor