Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/src/annotation_editing_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AnnotationEditingController extends TextEditingController {
final someVal = _mapping.isEmpty
? text
: text.splitMapJoin(
RegExp('$_pattern'),
RegExp('$_pattern(\\w*)'),
onMatch: (Match match) {
final mention = _mapping[match[0]!] ??
_mapping[_mapping.keys.firstWhere((element) {
Expand Down Expand Up @@ -55,14 +55,15 @@ class AnnotationEditingController extends TextEditingController {
}

@override
TextSpan buildTextSpan({BuildContext? context, TextStyle? style, bool? withComposing}) {
TextSpan buildTextSpan(
{BuildContext? context, TextStyle? style, bool? withComposing}) {
var children = <InlineSpan>[];

if (_pattern == null || _pattern == '()') {
children.add(TextSpan(text: text, style: style));
} else {
text.splitMapJoin(
RegExp('$_pattern'),
RegExp('$_pattern(\\w*)'),
onMatch: (Match match) {
if (_mapping.isNotEmpty) {
final mention = _mapping[match[0]!] ??
Expand Down