From 8e815e2af5a24abb04bb46676d1dd3ffef48258c Mon Sep 17 00:00:00 2001 From: shinich39 Date: Thu, 12 Dec 2024 06:40:00 +0900 Subject: [PATCH] fix cursor detection --- web/js/common/autocomplete.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/js/common/autocomplete.js b/web/js/common/autocomplete.js index 21bda1b..8bd0755 100644 --- a/web/js/common/autocomplete.js +++ b/web/js/common/autocomplete.js @@ -501,11 +501,10 @@ export class TextAreaAutoComplete { const includesMatches = []; for (const word of Object.keys(this.words)) { const lowerWord = word.toLocaleLowerCase(); - // Show exact matches - // if (lowerWord === term) { - // // Dont include exact matches - // continue; - // } + if (lowerWord === term) { + // Dont include exact matches + continue; + } const pos = lowerWord.indexOf(term); if (pos === -1) { @@ -624,7 +623,7 @@ export class TextAreaAutoComplete { value = this.#escapeParentheses(value); // Remove underscore - value = value.replace("_", " "); + value = value.replace(/_/g, " "); const afterCursor = this.helper.getAfterCursor(); const shouldAddSeparator = !afterCursor.trim().startsWith(this.separator.trim());