Extract UMI after insert update

This commit is contained in:
Dominik Reh
2023-01-29 17:36:02 +01:00
parent fad8b3dc88
commit b0347d1ca7
2 changed files with 27 additions and 17 deletions

View File

@@ -361,21 +361,7 @@ function insertTextAtCursor(textArea, result, tagword) {
previousTags = tags;
// Callback
processQueue(QUEUE_AFTER_INSERT, null, tagType);
// If it was a yaml wildcard, also update the umiPreviousTags
if (tagType === ResultType.yamlWildcard && originalTagword.length > 0) {
let umiSubPrompts = [...newPrompt.matchAll(UMI_PROMPT_REGEX)];
let umiTags = [];
umiSubPrompts.forEach(umiSubPrompt => {
umiTags = umiTags.concat([...umiSubPrompt[0].matchAll(UMI_TAG_REGEX)].map(x => x[1].toLowerCase()));
});
umiPreviousTags = umiTags;
hideResults(textArea);
}
processQueue(QUEUE_AFTER_INSERT, null, tagType, newPrompt, textArea);
// Hide results after inserting
if (tagType === ResultType.wildcardFile) {
@@ -383,7 +369,7 @@ function insertTextAtCursor(textArea, result, tagword) {
hideBlocked = true;
autocomplete(textArea, prompt, sanitizedText);
setTimeout(() => { hideBlocked = false; }, 100);
} else {
} else if (!hideBlocked && isVisible(textArea)) {
hideResults(textArea);
}
}