Merge pull request #403 from shinich39/feature/tags

Improve usability of Autocomplete
This commit is contained in:
pythongosssss
2025-01-02 20:07:33 +00:00
committed by GitHub
+8 -2
View File
@@ -536,9 +536,11 @@ export class TextAreaAutoComplete {
#update() {
let before = this.helper.getBeforeCursor();
if (before?.length) {
const m = before.match(/([^\s|,|;|"]+)$/);
const m = before.match(/([^,;"|{}()\n]+)$/);
if (m) {
before = m[0];
before = m[0]
.replace(/^\s+/, "")
.replace(/\s/g, "_") || null;
} else {
before = null;
}
@@ -619,6 +621,10 @@ export class TextAreaAutoComplete {
value = TextAreaAutoComplete.replacer(value);
}
value = this.#escapeParentheses(value);
// Remove underscore
value = value.replace(/_/g, " ");
const afterCursor = this.helper.getAfterCursor();
const shouldAddSeparator = !afterCursor.trim().startsWith(this.separator.trim());
this.helper.insertAtCursor(