From 58ae4704b256aa10d85f0bb0911880cf07acc971 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 14 Feb 2021 21:48:44 +0300 Subject: [PATCH] fix css autocomplete sort order --- edit/autocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edit/autocomplete.js b/edit/autocomplete.js index ce9912e6..4e30c1f7 100644 --- a/edit/autocomplete.js +++ b/edit/autocomplete.js @@ -149,12 +149,13 @@ } function initCssProps() { - cssProps = addSuffix(cssMime.propertyKeywords).sort(); + cssProps = addSuffix(cssMime.propertyKeywords); cssMedia = [].concat(...Object.entries(cssMime).map(getMediaKeys).filter(Boolean)).sort(); } function addSuffix(obj, suffix = ': ') { - return Object.keys(obj).map(k => k + suffix); + // Sorting first, otherwise "foo-bar:" would precede "foo:" + return Object.keys(obj).sort().map(k => k + suffix); } function getMediaKeys([k, v]) {