From 446ac14e7fa9098b1dbc0ca53f4be6ef063b38fa Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sun, 1 Oct 2023 23:47:02 +0200 Subject: [PATCH] Fix umi list not resetting after deleting chars behind "[" --- javascript/ext_umi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/ext_umi.js b/javascript/ext_umi.js index a55f80c..ea5067a 100644 --- a/javascript/ext_umi.js +++ b/javascript/ext_umi.js @@ -129,7 +129,7 @@ class UmiParser extends BaseTagParser { return; } - let umiTagword = diff[0] || ''; + let umiTagword = tagCountChange < 0 ? '' : diff[0] || ''; let tempResults = []; if (umiTagword && umiTagword.length > 0) { umiTagword = umiTagword.toLowerCase().replace(/[\n\r]/g, ""); @@ -188,7 +188,7 @@ class UmiParser extends BaseTagParser { } } -function updateUmiTags( tagType, sanitizedText, newPrompt, textArea) { +function updateUmiTags(tagType, sanitizedText, newPrompt, textArea) { // If it was a umi wildcard, also update the umiPreviousTags if (tagType === ResultType.umiWildcard && originalTagword.length > 0) { let umiSubPrompts = [...newPrompt.matchAll(UMI_PROMPT_REGEX)];