diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm index 46af8dd395..515e3772e1 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm @@ -142,56 +142,6 @@ static NSString* const kMultilineInputType = @"TextInputType.multiline"; [_textInputContext handleEvent:event]; } -#pragma mark - -#pragma mark NSStandardKeyBindingMethods - -/** - * Note, experimentation indicates that moveRight and moveLeft are called rather - * than the supposedly more RTL-friendly moveForward and moveBackward. - */ -- (void)moveLeft:(nullable id)sender { - NSRange selection = self.activeModel.selectedRange; - if (selection.length == 0) { - if (selection.location > 0) { - // Move to previous location - self.activeModel.selectedRange = NSMakeRange(selection.location - 1, 0); - [self updateEditState]; - } - } else { - // Collapse current selection - self.activeModel.selectedRange = NSMakeRange(selection.location, 0); - [self updateEditState]; - } -} - -- (void)moveRight:(nullable id)sender { - NSRange selection = self.activeModel.selectedRange; - if (selection.length == 0) { - if (selection.location < self.activeModel.text.length) { - // Move to next location - self.activeModel.selectedRange = NSMakeRange(selection.location + 1, 0); - [self updateEditState]; - } - } else { - // Collapse current selection - self.activeModel.selectedRange = NSMakeRange(selection.location + selection.length, 0); - [self updateEditState]; - } -} - -- (void)deleteBackward:(id)sender { - NSRange selection = self.activeModel.selectedRange; - NSRange range = selection; - if (selection.length == 0) { - if (selection.location == 0) - return; - NSUInteger location = (selection.location == NSNotFound) ? self.activeModel.text.length - 1 - : selection.location - 1; - range = NSMakeRange(location, 1); - } - [self insertText:@"" replacementRange:range]; // Updates edit state -} - #pragma mark - #pragma mark NSTextInputClient