add ":" to prop names in css autocomplete menu (#915)

This commit is contained in:
tophf 2020-05-01 08:52:18 +03:00 committed by GitHub
parent 81b6137d8a
commit 7ab0651e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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