diff --git a/runtime/menu.vim b/runtime/menu.vim index b6a979434f..c8fd60e563 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -165,6 +165,7 @@ if has("gui_macvim") an 10.330 &File.Close\ Window:qa :conf qa tln 10.330 &File.Close\ Window:qa :conf qa an 10.332 &File.Close:q :conf q + tln 10.332 &File.Close:q :conf q an 10.341 &File.Save\ All :browse conf wa an 10.350 &File.Save\ As…:sav :browse confirm saveas else diff --git a/src/MacVim/MMAppController.h b/src/MacVim/MMAppController.h index f043fd1e4f..1e0782cbdd 100644 --- a/src/MacVim/MMAppController.h +++ b/src/MacVim/MMAppController.h @@ -20,7 +20,13 @@ #endif -@interface MMAppController : NSObject { +@interface MMAppController : NSObject < + MMAppProtocol, + NSUserInterfaceItemSearching +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 + , NSMenuItemValidation +#endif +> { NSConnection *connection; NSMutableArray *vimControllers; NSString *openSelectionString; @@ -63,6 +69,11 @@ - (void)refreshAllResizeConstraints; - (void)refreshAllTextViews; +// +// NSMenuItemValidation +// +- (BOOL)validateMenuItem:(NSMenuItem *)item; + - (IBAction)newWindow:(id)sender; - (IBAction)newWindowAndActivate:(id)sender; - (IBAction)fileOpen:(id)sender; diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 10bddcba3b..eda69bf161 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -1160,6 +1160,14 @@ fsEventCallback(ConstFSEventStreamRef streamRef, } } +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + // For the actions defined in this class we do want them to always be + // enabled since they are usually app functionality and independent of + // each Vim's state. + return YES; +} + - (IBAction)newWindow:(id)sender { ASLogDebug(@"Open new window");