mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix no executor found
This commit is contained in:
@ -1818,7 +1818,7 @@ export function setSlashCommandAutoComplete(textarea, isFloating = false) {
|
|||||||
executor = parser.getCommandAt(text, textarea.selectionStart);
|
executor = parser.getCommandAt(text, textarea.selectionStart);
|
||||||
let slashCommand = executor?.name?.toLowerCase() ?? '';
|
let slashCommand = executor?.name?.toLowerCase() ?? '';
|
||||||
isReplacable = isInput && (!executor ? true : textarea.selectionStart == executor.start - 2 + executor.name.length + 1);
|
isReplacable = isInput && (!executor ? true : textarea.selectionStart == executor.start - 2 + executor.name.length + 1);
|
||||||
if ((isForced || isInput) && textarea.selectionStart > executor.start - 2 && textarea.selectionStart <= executor.start - 2 + executor.name.length + 1) {
|
if ((isForced || isInput) && executor && textarea.selectionStart > executor.start - 2 && textarea.selectionStart <= executor.start - 2 + executor.name.length + 1) {
|
||||||
slashCommand = slashCommand.slice(0, textarea.selectionStart - (executor.start - 2) - 1);
|
slashCommand = slashCommand.slice(0, textarea.selectionStart - (executor.start - 2) - 1);
|
||||||
executor.name = slashCommand;
|
executor.name = slashCommand;
|
||||||
executor.end = executor.start + slashCommand.length;
|
executor.end = executor.start + slashCommand.length;
|
||||||
|
Reference in New Issue
Block a user