diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index 2080643d12..fe588048fe 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -71,6 +71,8 @@ @interface MMAlert : NSAlert { } - (void)setTextFieldString:(NSString *)textFieldString; - (NSTextField *)textField; +- (void)beginSheetModalForWindow:(NSWindow *)window + modalDelegate:(id)delegate; @end @@ -1533,9 +1535,7 @@ - (void)handleShowDialog:(NSDictionary *)attr } [alert beginSheetModalForWindow:[windowController window] - modalDelegate:self - didEndSelector:@selector(alertDidEnd:code:context:) - contextInfo:NULL]; + modalDelegate:self]; [alert release]; } @@ -1602,13 +1602,19 @@ - (void)setInformativeText:(NSString *)text - (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate - didEndSelector:(SEL)didEndSelector - contextInfo:(void *)contextInfo { + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 + [super beginSheetModalForWindow:window + completionHandler:^(NSModalResponse code) { + [delegate alertDidEnd:self code:code context:NULL]; + }]; +#else [super beginSheetModalForWindow:window modalDelegate:delegate - didEndSelector:didEndSelector - contextInfo:contextInfo]; + didEndSelector:@selector(alertDidEnd:code:context:) + contextInfo:NULL]; +#endif // HACK! Place the input text field at the bottom of the informative text // (which has been made a bit larger by adding newline characters).