Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ - (void)setTextInputState:(NSDictionary*)state {
[self.text setString:newText];
}

NSInteger composingBase = [state[@"composingBase"] intValue];
NSInteger composingExtent = [state[@"composingExtent"] intValue];
NSRange composingRange = [self clampSelection:NSMakeRange(MIN(composingBase, composingExtent),
ABS(composingBase - composingExtent))
forText:self.text];
self.markedTextRange =
composingRange.length > 0 ? [FlutterTextRange rangeWithNSRange:composingRange] : nil;

NSInteger selectionBase = [state[@"selectionBase"] intValue];
NSInteger selectionExtent = [state[@"selectionExtent"] intValue];
NSRange selectedRange = [self clampSelection:NSMakeRange(MIN(selectionBase, selectionExtent),
Expand All @@ -233,14 +241,6 @@ - (void)setTextInputState:(NSDictionary*)state {
[self.inputDelegate selectionDidChange:self];
}

NSInteger composingBase = [state[@"composingBase"] intValue];
NSInteger composingExtent = [state[@"composingExtent"] intValue];
NSRange composingRange = [self clampSelection:NSMakeRange(MIN(composingBase, composingExtent),
ABS(composingBase - composingExtent))
forText:self.text];
self.markedTextRange =
composingRange.length > 0 ? [FlutterTextRange rangeWithNSRange:composingRange] : nil;

if (textChanged) {
[self.inputDelegate textDidChange:self];

Expand Down