diff --git a/src/MacVim/Info.plist b/src/MacVim/Info.plist
index 2a681fc971..08a181f9e9 100644
--- a/src/MacVim/Info.plist
+++ b/src/MacVim/Info.plist
@@ -569,7 +569,7 @@
NSMenuItem
default
- MacVim/New Tab Containing Selection
+ MacVim/New Document Containing Selection
NSMessage
openSelection
@@ -584,24 +584,7 @@
NSMenuItem
default
- MacVim/Open Selected File in Tab
-
- NSMessage
- openFile
- NSPortName
- MacVim
- NSSendTypes
-
- NSStringPboardType
-
- NSUserData
- Tab
-
-
- NSMenuItem
-
- default
- MacVim/Open Selected File in Window
+ MacVim/Open Selected File
NSMessage
openFile
@@ -614,7 +597,7 @@
NSUserData
Window
-
+
NSMenuItem
default
@@ -630,7 +613,7 @@
NSUserData
Window
-
+
SUFeedURL
http://bjorn.winckler.googlepages.com/macvim_latest.xml
diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m
index b80cd256c7..51d397d3ae 100644
--- a/src/MacVim/MMAppController.m
+++ b/src/MacVim/MMAppController.m
@@ -1136,16 +1136,17 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
return;
}
- MMVimController *vc = [self topmostVimController];
- if (vc) {
- // Open a new tab first, since dropString: does not do this.
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+ BOOL openInCurrentWindow = [ud boolForKey:MMOpenInCurrentWindowKey];
+ MMVimController *vc;
+
+ if (openInCurrentWindow && (vc = [self topmostVimController])) {
[vc sendMessage:AddNewTabMsgID data:nil];
[vc dropString:[pboard stringForType:NSStringPboardType]];
} else {
- // NOTE: There is no window to paste the selection into, so save the
- // text, open a new window, and paste the text when the next window
- // opens. (If this is called several times in a row, then all but the
- // last call might be ignored.)
+ // Save the text, open a new window, and paste the text when the next
+ // window opens. (If this is called several times in a row, then all
+ // but the last call may be ignored.)
if (openSelectionString) [openSelectionString release];
openSelectionString = [[pboard stringForType:NSStringPboardType] copy];
@@ -1170,16 +1171,17 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
NSArray *filenames = [self filterFilesAndNotify:
[NSArray arrayWithObject:string]];
- if ([filenames count] > 0) {
- MMVimController *vc = nil;
- if (userData && [userData isEqual:@"Tab"])
- vc = [self topmostVimController];
+ if ([filenames count] == 0)
+ return;
- if (vc) {
- [vc dropFiles:filenames forceOpen:YES];
- } else {
- [self openFiles:filenames withArguments:nil];
- }
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+ BOOL openInCurrentWindow = [ud boolForKey:MMOpenInCurrentWindowKey];
+ MMVimController *vc;
+
+ if (openInCurrentWindow && (vc = [self topmostVimController])) {
+ [vc dropFiles:filenames forceOpen:YES];
+ } else {
+ [self openFiles:filenames withArguments:nil];
}
}
@@ -1206,11 +1208,11 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
path = [path stringByReplacingOccurrencesOfString:@" " withString:@"\\ "];
- MMVimController *vc = [self topmostVimController];
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
BOOL openInCurrentWindow = [ud boolForKey:MMOpenInCurrentWindowKey];
+ MMVimController *vc;
- if (vc && openInCurrentWindow) {
+ if (openInCurrentWindow && (vc = [self topmostVimController])) {
NSString *input = [NSString stringWithFormat:@""
":tabe|cd %@", path];
[vc addVimInput:input];