mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
don't run parser for getNameAt if text has not changed
This commit is contained in:
@ -178,11 +178,13 @@ export class SlashCommandParser {
|
||||
* @param {*} index Index to check for names (cursor position).
|
||||
*/
|
||||
getNameAt(text, index) {
|
||||
try {
|
||||
this.parse(text, false);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
console.warn(e);
|
||||
if (this.text != `{:${text}:}`) {
|
||||
try {
|
||||
this.parse(text, false);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
index += 2;
|
||||
const executor = this.commandIndex
|
||||
|
Reference in New Issue
Block a user