File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -33,21 +33,21 @@ extension ComposeContentAutocomplete on ComposeContentController {
33
33
34
34
final textUntilCursor = text.substring (0 , selection.end);
35
35
for (int pos = selection.end - 1 ; pos >= earliest; pos-- ) {
36
- if (textUntilCursor[pos] != '@' ) {
37
- continue ;
36
+ final charAtPos = textUntilCursor[pos];
37
+ if (charAtPos == '@' ) {
38
+ final match = _mentionIntentRegex.matchAsPrefix (textUntilCursor, pos);
39
+ if (match == null ) {
40
+ continue ;
41
+ }
42
+ if (selection.start < pos) {
43
+ // See comment about [TextSelection.isCollapsed] above.
44
+ return null ;
45
+ }
46
+ return AutocompleteIntent (
47
+ syntaxStart: pos,
48
+ query: MentionAutocompleteQuery (match[2 ]! , silent: match[1 ]! == '_' ),
49
+ textEditingValue: value);
38
50
}
39
- final match = _mentionIntentRegex.matchAsPrefix (textUntilCursor, pos);
40
- if (match == null ) {
41
- continue ;
42
- }
43
- if (selection.start < pos) {
44
- // See comment about [TextSelection.isCollapsed] above.
45
- return null ;
46
- }
47
- return AutocompleteIntent (
48
- syntaxStart: pos,
49
- query: MentionAutocompleteQuery (match[2 ]! , silent: match[1 ]! == '_' ),
50
- textEditingValue: value);
51
51
}
52
52
return null ;
53
53
}
You can’t perform that action at this time.
0 commit comments