diff --git a/src/nsterm.h b/src/nsterm.h index e3f55c4e41c..a07829a36ec 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -463,7 +463,7 @@ enum ns_return_frame_mode @class EmacsLayer; #ifdef NS_IMPL_COCOA -@interface EmacsView : NSView +@interface EmacsView : NSView #else @interface EmacsView : NSView #endif diff --git a/src/nsterm.m b/src/nsterm.m index 8a0c12c7369..b56c587bc69 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7032,10 +7032,49 @@ In that case we use UCKeyTranslate (ns_get_shifted_character) [nsEvArray removeObject: theEvent]; } +/*********************************************************************** + NSTextInputClient + ***********************************************************************/ + +#ifdef NS_IMPL_COCOA + +- (void) insertText: (id) string + replacementRange: (NSRange) replacementRange +{ + if ([string isKindOfClass:[NSAttributedString class]]) + string = [string string]; + [self unmarkText]; + [self insertText:string]; +} + +- (void) setMarkedText: (id) string + selectedRange: (NSRange) selectedRange + replacementRange: (NSRange) replacementRange +{ + [self setMarkedText: string selectedRange: selectedRange]; +} + +- (nullable NSAttributedString *) + attributedSubstringForProposedRange: (NSRange) range + actualRange: (nullable NSRangePointer) actualRange +{ + return nil; +} + +- (NSRect) firstRectForCharacterRange: (NSRange) range + actualRange: (nullable NSRangePointer) actualRange +{ + return NSZeroRect; +} + +#endif /* NS_IMPL_COCOA */ + +/*********************************************************************** + NSTextInput + ***********************************************************************/ /* implementation (called through [super interpretKeyEvents:]). */ - /* : called when done composing; NOTE: also called when we delete over working text, followed immediately by doCommandBySelector: deleteBackward: */