From 10e786dfd31ef1f8dd5d0028556b491f9329b1be Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Wed, 17 Apr 2024 09:01:41 -0400 Subject: [PATCH] don't run parser for getNameAt if text has not changed --- public/scripts/slash-commands/SlashCommandParser.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/scripts/slash-commands/SlashCommandParser.js b/public/scripts/slash-commands/SlashCommandParser.js index 18e6f247b..3d37eaf3e 100644 --- a/public/scripts/slash-commands/SlashCommandParser.js +++ b/public/scripts/slash-commands/SlashCommandParser.js @@ -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