Merge pull request #403 from shinich39/feature/tags
Improve usability of Autocomplete
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user