restore selection on non-replace select

This commit is contained in:
LenAnderson
2024-04-17 09:02:37 -04:00
parent ed01e94c9f
commit 38e468dc4f

View File

@ -2266,6 +2266,13 @@ export async function setSlashCommandAutoComplete(textarea, isFloating = false)
textarea.selectionStart = parserResult.start - 2 + selectedItem.replacer.length;
textarea.selectionEnd = textarea.selectionStart;
show();
} else {
const selectionStart = textarea.selectionStart;
const selectionEnd = textarea.selectionDirection;
await pointerup;
textarea.focus();
textarea.selectionStart = selectionStart;
textarea.selectionDirection = selectionEnd;
}
};
const showAutoCompleteDebounced = show;