From 0aaf5f1957bfd366c184fa6de7a8c3dad1d97acc Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Thu, 10 Jul 2014 14:46:05 +1000 Subject: Fix the insertText: method on ScintillaView to accept NSAttributedString as well as NSString, since insertText: is from the NSResponder superclass where it is defined to accept both. --- cocoa/ScintillaView.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cocoa/ScintillaView.mm') diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index bca3b167f..2ca7ed6bc 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -1658,9 +1658,12 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) //-------------------------------------------------------------------------------------------------- -- (void)insertText: (NSString*)text +- (void)insertText: (id) aString { - mBackend->InsertText(text); + if ([aString isKindOfClass:[NSString class]]) + mBackend->InsertText(aString); + else if ([aString isKindOfClass:[NSAttributedString class]]) + mBackend->InsertText([aString string]); } //-------------------------------------------------------------------------------------------------- -- cgit v1.2.3