mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
add /breakpoint to command list and block it
This commit is contained in:
parent
9b3cd719d7
commit
ed8f923b7a
@ -51,7 +51,7 @@ export class SlashCommandParser {
|
||||
* @param {SlashCommand} command
|
||||
*/
|
||||
static addCommandObject(command) {
|
||||
const reserved = ['/', '#', ':', 'parser-flag'];
|
||||
const reserved = ['/', '#', ':', 'parser-flag', 'breakpoint'];
|
||||
for (const start of reserved) {
|
||||
if (command.name.toLowerCase().startsWith(start) || (command.aliases ?? []).find(a=>a.toLowerCase().startsWith(start))) {
|
||||
throw new Error(`Illegal Name. Slash command name cannot begin with "${start}".`);
|
||||
@ -153,6 +153,11 @@ export class SlashCommandParser {
|
||||
helpString: 'Write a comment.',
|
||||
}));
|
||||
}
|
||||
if (!Object.keys(this.commands).includes('breakpoint')) {
|
||||
SlashCommandParser.addCommandObjectUnsafe(SlashCommand.fromProps({ name: 'breakpoint',
|
||||
helpString: 'Set a breakpoint for debugging in the QR Editor.',
|
||||
}));
|
||||
}
|
||||
|
||||
//TODO should not be re-registered from every instance
|
||||
this.registerLanguage();
|
||||
|
Loading…
Reference in New Issue
Block a user