mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
"New Window" item on Dock menu activates MacVim
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
<string>id</string>
|
||||
<key>newWindow</key>
|
||||
<string>id</string>
|
||||
<key>newWindowAndActivate</key>
|
||||
<string>id</string>
|
||||
<key>openWebsite</key>
|
||||
<string>id</string>
|
||||
<key>orderFrontPreferencePanel</key>
|
||||
|
||||
+1
-3
@@ -9,9 +9,7 @@
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>218</integer>
|
||||
</array>
|
||||
<array/>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9E17</string>
|
||||
<key>targetFramework</key>
|
||||
|
||||
Binary file not shown.
@@ -27,6 +27,7 @@
|
||||
NSMenuItem *recentFilesMenuItem;
|
||||
NSMutableArray *cachedVimControllers;
|
||||
int preloadPid;
|
||||
BOOL shouldActivateWhenNextWindowOpens;
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
NSMenuItem *plugInMenuItem;
|
||||
@@ -50,6 +51,7 @@
|
||||
- (void)setPreloadCacheSize:(int)size;
|
||||
|
||||
- (IBAction)newWindow:(id)sender;
|
||||
- (IBAction)newWindowAndActivate:(id)sender;
|
||||
- (IBAction)fileOpen:(id)sender;
|
||||
- (IBAction)selectNextWindow:(id)sender;
|
||||
- (IBAction)selectPreviousWindow:(id)sender;
|
||||
|
||||
@@ -110,6 +110,7 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
- (void)clearPreloadCacheWithCount:(int)count;
|
||||
- (NSDate *)rcFilesModificationDate;
|
||||
- (BOOL)openVimControllerWithArguments:(NSDictionary *)arguments;
|
||||
- (void)activateWhenNextWindowOpens;
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)removePlugInMenu;
|
||||
@@ -724,6 +725,11 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
[openSelectionString release];
|
||||
openSelectionString = nil;
|
||||
}
|
||||
|
||||
if (shouldActivateWhenNextWindowOpens) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
shouldActivateWhenNextWindowOpens = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setMainMenu:(NSMenu *)mainMenu
|
||||
@@ -849,6 +855,12 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)newWindowAndActivate:(id)sender
|
||||
{
|
||||
[self activateWhenNextWindowOpens];
|
||||
[self newWindow:sender];
|
||||
}
|
||||
|
||||
- (IBAction)fileOpen:(id)sender
|
||||
{
|
||||
NSString *dir = nil;
|
||||
@@ -1583,6 +1595,11 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)activateWhenNextWindowOpens
|
||||
{
|
||||
shouldActivateWhenNextWindowOpens = YES;
|
||||
}
|
||||
|
||||
@end // MMAppController (Private)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user