Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[macOS] Add XCode marks for TextInputPlugin #39550

Merged
merged 1 commit into from
Feb 10, 2023
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 @@ -20,7 +20,7 @@

static NSString* const kTextInputChannel = @"flutter/textinput";

#pragma mark - Textinput channel method names
#pragma mark - TextInput channel method names
// See https://api.flutter.dev/flutter/services/SystemChannels/textInput-constant.html
static NSString* const kSetClientMethod = @"TextInput.setClient";
static NSString* const kShowMethod = @"TextInput.show";
Expand Down Expand Up @@ -62,6 +62,7 @@
static NSString* const kTextAffinityDownstream = @"TextAffinity.downstream";
static NSString* const kTextAffinityUpstream = @"TextAffinity.upstream";

#pragma mark - Enums
/**
* The affinity of the current cursor position. If the cursor is at a position representing
* a line break, the cursor may be drawn either at the end of the current line (upstream)
Expand All @@ -72,6 +73,8 @@ typedef NS_ENUM(NSUInteger, FlutterTextAffinity) {
kFlutterTextAffinityDownstream
};

#pragma mark - Static functions

/*
* Updates a range given base and extent fields.
*/
Expand Down Expand Up @@ -135,6 +138,8 @@ static BOOL EnableAutocomplete(NSDictionary* configuration) {
return EnableAutocompleteForTextInputConfiguration(configuration);
}

#pragma mark - NSEvent (KeyEquivalentMarker) protocol

@interface NSEvent (KeyEquivalentMarker)

// Internally marks that the event was received through performKeyEquivalent:.
Expand Down Expand Up @@ -164,6 +169,8 @@ - (BOOL)isKeyEquivalent {

@end

#pragma mark - FlutterTextInputPlugin private interface

/**
* Private properties of FlutterTextInputPlugin.
*/
Expand Down Expand Up @@ -285,6 +292,8 @@ - (NSString*)textAffinityString;

@end

#pragma mark - FlutterTextInputPlugin

@implementation FlutterTextInputPlugin {
/**
* The currently active text input model.
Expand Down