diff --git a/public/scripts/slash-commands/SlashCommandParser.js b/public/scripts/slash-commands/SlashCommandParser.js index e99c1e964..c7066791d 100644 --- a/public/scripts/slash-commands/SlashCommandParser.js +++ b/public/scripts/slash-commands/SlashCommandParser.js @@ -244,9 +244,11 @@ export class SlashCommandParser { contains: [], }; const ABORT = { - scope: 'abort', begin: /\/(abort|breakpoint)/, - end: /\||$|:}/, + beginScope: 'abort', + end: /\||$|(?=:})/, + excludeEnd: false, + returnEnd: true, contains: [], }; const IMPORT = { @@ -258,6 +260,15 @@ export class SlashCommandParser { returnEnd: true, contains: [], }; + const BREAK = { + scope: 'command', + begin: /\/(break)/, + beginScope: 'keyword', + end: /\||$|(?=:})/, + excludeEnd: false, + returnEnd: true, + contains: [], + }; const LET = { begin: [ /\/(let|var)\s+/, @@ -290,6 +301,7 @@ export class SlashCommandParser { match: [ /\/:/, getQuotedRunRegex(), + /\||$|(?=:})/, ], className: { 1: 'variable.language', @@ -353,6 +365,14 @@ export class SlashCommandParser { CLOSURE, hljs.QUOTE_STRING_MODE, ); + BREAK.contains.push( + hljs.BACKSLASH_ESCAPE, + NAMED_ARG, + NUMBER, + MACRO, + CLOSURE, + hljs.QUOTE_STRING_MODE, + ); LET.contains.push( hljs.BACKSLASH_ESCAPE, NAMED_ARG, @@ -377,6 +397,14 @@ export class SlashCommandParser { MACRO, CLOSURE, ); + ABORT.contains.push( + hljs.BACKSLASH_ESCAPE, + NAMED_ARG, + NUMBER, + MACRO, + CLOSURE, + hljs.QUOTE_STRING_MODE, + ); COMMAND.contains.push( hljs.BACKSLASH_ESCAPE, NAMED_ARG, @@ -391,6 +419,7 @@ export class SlashCommandParser { COMMENT, ABORT, IMPORT, + BREAK, NAMED_ARG, NUMBER, MACRO, @@ -413,6 +442,7 @@ export class SlashCommandParser { COMMENT, ABORT, IMPORT, + BREAK, RUN, LET, GETVAR, diff --git a/public/style.css b/public/style.css index 6ca77474b..c3174f6fa 100644 --- a/public/style.css +++ b/public/style.css @@ -1567,20 +1567,18 @@ body[data-stscript-style] .hljs.language-stscript { color: var(--ac-style-color-punctuation); } - .hljs-keyword { - color: var(--ac-style-color-variableLanguage); - } - .hljs-comment { color: var(--ac-style-color-comment); } .hljs-abort { color: var(--ac-style-color-abort, #e38e23); + font-weight: bold; } .hljs-keyword { color: var(--ac-style-color-keyword); + font-weight: bold; } .hljs-pipe {