fix cursor detection

This commit is contained in:
shinich39
2024-12-12 06:40:00 +09:00
parent d89dae5c28
commit 8e815e2af5
+5 -6
View File
@@ -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());