Merge pull request #1310 from ychin/macvim-file-close-terminal

Add File.Close support for terminal which also makes it work for Cmd-W
This commit is contained in:
Yee Cheng Chin
2022-10-09 16:11:30 -07:00
committed by GitHub
3 changed files with 21 additions and 1 deletions
+1
View File
@@ -165,6 +165,7 @@ if has("gui_macvim")
an <silent> 10.330 &File.Close\ Window<Tab>:qa :conf qa<CR>
tln <silent> 10.330 &File.Close\ Window<Tab>:qa <C-W>:conf qa<CR>
an <silent> 10.332 &File.Close<Tab>:q :conf q<CR>
tln <silent> 10.332 &File.Close<Tab>:q <C-W>:conf q<CR>
an <silent> 10.341 &File.Save\ All :browse conf wa<CR>
an 10.350 &File.Save\ As<Tab>:sav :browse confirm saveas<CR>
else
+12 -1
View File
@@ -20,7 +20,13 @@
#endif
@interface MMAppController : NSObject <MMAppProtocol, NSUserInterfaceItemSearching> {
@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;
+8
View File
@@ -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");