@@ -380,9 +380,10 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
380380 NSString *url = (NSString *)args[3 ];
381381 [self addLinkAt: start end: end text: text url: url];
382382 } else if ([commandName isEqualToString: @" addMention" ]) {
383- NSString *text = (NSString *)args[0 ];
384- NSString *attributes = (NSString *)args[1 ];
385- [self addMentionWithText: text attributes: attributes];
383+ NSString *indicator = (NSString *)args[0 ];
384+ NSString *text = (NSString *)args[1 ];
385+ NSString *attributes = (NSString *)args[2 ];
386+ [self addMention: indicator text: text attributes: attributes];
386387 } else if ([commandName isEqualToString: @" startMention" ]) {
387388 NSString *indicator = (NSString *)args[0 ];
388389 [self startMentionWithIndicator: indicator];
@@ -468,13 +469,13 @@ - (void)addLinkAt:(NSInteger)start end:(NSInteger)end text:(NSString *)text url:
468469 }
469470}
470471
471- - (void )addMentionWithText : (NSString *)text attributes : (NSString *)attributes {
472+ - (void )addMention : ( NSString *) indicator text : (NSString *)text attributes : (NSString *)attributes {
472473 MentionStyle *mentionStyleClass = (MentionStyle *)stylesDict[@([MentionStyle getStyleType ])];
473474 if (mentionStyleClass == nullptr ) { return ; }
474475 if ([mentionStyleClass getActiveMentionRange ] == nullptr ) { return ; }
475476
476477 if ([self handleStyleBlocksAndConflicts: [MentionStyle getStyleType ] range: [[mentionStyleClass getActiveMentionRange ] rangeValue ]]) {
477- [mentionStyleClass addMentionWithText : text attributes: attributes];
478+ [mentionStyleClass addMention: indicator text : text attributes: attributes];
478479 [self tryUpdatingActiveStyles ];
479480 }
480481}
0 commit comments