don't run parser for getNameAt if text has not changed
This commit is contained in:
parent
acdfd10752
commit
10e786dfd3
|
@ -178,12 +178,14 @@ export class SlashCommandParser {
|
|||
* @param {*} index Index to check for names (cursor position).
|
||||
*/
|
||||
getNameAt(text, index) {
|
||||
if (this.text != `{:${text}:}`) {
|
||||
try {
|
||||
this.parse(text, false);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
index += 2;
|
||||
const executor = this.commandIndex
|
||||
.filter(it=>it.start <= index && (it.end >= index || it.end == null))
|
||||
|
|
Loading…
Reference in New Issue