mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix "no match" autocomplete message
This commit is contained in:
@ -2103,6 +2103,11 @@ export async function setSlashCommandAutoComplete(textarea, isFloating = false)
|
|||||||
return hide();
|
return hide();
|
||||||
}
|
}
|
||||||
// otherwise add "no match" notice
|
// otherwise add "no match" notice
|
||||||
|
const option = new SlashCommandAutoCompleteOption(
|
||||||
|
OPTION_TYPE.BLANK,
|
||||||
|
null,
|
||||||
|
'',
|
||||||
|
);
|
||||||
switch (parserResult?.type) {
|
switch (parserResult?.type) {
|
||||||
case NAME_RESULT_TYPE.CLOSURE: {
|
case NAME_RESULT_TYPE.CLOSURE: {
|
||||||
const li = document.createElement('li'); {
|
const li = document.createElement('li'); {
|
||||||
@ -2110,24 +2115,16 @@ export async function setSlashCommandAutoComplete(textarea, isFloating = false)
|
|||||||
`No matching variables in scope and no matching Quick Replies for "${slashCommand}"`
|
`No matching variables in scope and no matching Quick Replies for "${slashCommand}"`
|
||||||
: 'No variables in scope and no Quick Replies found.';
|
: 'No variables in scope and no Quick Replies found.';
|
||||||
}
|
}
|
||||||
result.push({
|
option.dom = li;
|
||||||
name: '',
|
result.push(option);
|
||||||
value: null,
|
|
||||||
score: null,
|
|
||||||
li,
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NAME_RESULT_TYPE.COMMAND: {
|
case NAME_RESULT_TYPE.COMMAND: {
|
||||||
const li = document.createElement('li'); {
|
const li = document.createElement('li'); {
|
||||||
li.textContent = `No matching commands for "/${slashCommand}"`;
|
li.textContent = `No matching commands for "/${slashCommand}"`;
|
||||||
}
|
}
|
||||||
result.push({
|
option.dom = li;
|
||||||
name: '',
|
result.push(option);
|
||||||
value: null,
|
|
||||||
score: null,
|
|
||||||
li,
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user