From d8d991531aaa7eafc285583685eaff5b7c85b723 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Wed, 13 Sep 2023 22:04:59 +0200 Subject: [PATCH] Don't sort umi tags since they use count --- javascript/tagAutocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index bf0ea1c..06bb7b0 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -1014,8 +1014,9 @@ async function autocomplete(textArea, prompt, fixedTag = null) { if (resultCandidates && resultCandidates.length > 0) { // Flatten our candidate(s) results = resultCandidates.flat(); - // Sort results - results = results.sort(getSortFunction()); + // Sort results, but not if it's umi tags since they are sorted by count + if (!(resultCandidates.length === 1 && results[0].type === ResultType.umiWildcard)) + results = results.sort(getSortFunction()); // Since some tags are kaomoji, we have to add the normal results in some cases if (tagword.startsWith("<") || tagword.startsWith("*<")) {