Compare commits

...

3 Commits

Author SHA1 Message Date
Bjorn Winckler 76f937b87b Snapshot 55 2010-10-05 21:14:36 +02:00
Bjorn Winckler c96d4dcc8e Do not change pwd on open file for onscreen window
This change is to make the behavior more consistent and easier to
predict (e.g. when MacVim is used with PeepOpen).

If opening new files causes a new window to appear on screen, then the
pwd is set to the directory of the first file being opened.

If a window is already visible and new files are set to open in the
"current" window, then the pwd will not change when opening files.
2010-10-03 17:49:23 +02:00
Bjorn Winckler cc43c3f65c Fix inline marked text regression
This regression was introduced in commit be8446006b.
2010-10-02 19:21:20 +02:00
3 changed files with 26 additions and 23 deletions
+1 -1
View File
@@ -1202,7 +1202,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>54</string>
<string>55</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+23 -20
View File
@@ -193,7 +193,6 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
- (void)handleOpenWithArguments:(NSDictionary *)args;
- (BOOL)checkForModifiedBuffers;
- (void)addInput:(NSString *)input;
- (BOOL)unusedEditor;
- (void)redrawScreen;
- (void)handleFindReplace:(NSDictionary *)args;
- (void)handleMarkedText:(NSData *)data;
@@ -1250,6 +1249,15 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
} else {
ASLogDebug(@"Dropping repeated keyboard input");
}
} else if (SetMarkedTextMsgID == msgid) {
// NOTE: This message counts as keyboard input...
[self handleMarkedText:data];
} else if (ActivatedImMsgID == msgid) {
// NOTE: This message counts as keyboard input...
[self setImState:YES];
} else if (DeactivatedImMsgID == msgid) {
// NOTE: This message counts as keyboard input...
[self setImState:NO];
} else if (TerminateNowMsgID == msgid) {
// Terminate immediately (the frontend is about to quit or this process
// was aborted). Don't preserve modified files since the user would
@@ -2039,16 +2047,10 @@ static void netbeansReadCallback(CFSocketRef s,
[self handleOpenWithArguments:[NSDictionary dictionaryWithData:data]];
} else if (FindReplaceMsgID == msgid) {
[self handleFindReplace:[NSDictionary dictionaryWithData:data]];
} else if (ActivatedImMsgID == msgid) {
[self setImState:YES];
} else if (DeactivatedImMsgID == msgid) {
[self setImState:NO];
} else if (NetBeansMsgID == msgid) {
#ifdef FEAT_NETBEANS_INTG
netbeans_read();
#endif
} else if (SetMarkedTextMsgID == msgid) {
[self handleMarkedText:data];
} else if (ZoomMsgID == msgid) {
if (!data) return;
const void *bytes = [data bytes];
@@ -2637,19 +2639,6 @@ static void netbeansReadCallback(CFSocketRef s,
BOOL openFiles = ![[args objectForKey:@"dontOpen"] boolValue];
int layout = [[args objectForKey:@"layout"] intValue];
// Change to directory of first file to open if this is an "unused" editor
// (but do not do this if editing remotely).
if (openFiles && numFiles > 0 && ![args objectForKey:@"remoteID"]
&& (starting || [self unusedEditor]) ) {
char_u *s = [[filenames objectAtIndex:0] vimStringSave];
if (mch_isdir(s)) {
mch_chdir((char*)s);
} else {
vim_chdirfile(s);
}
vim_free(s);
}
if (starting > 0) {
// When Vim is starting we simply add the files to be opened to the
// global arglist and Vim will take care of opening them for us.
@@ -2669,6 +2658,20 @@ static void netbeansReadCallback(CFSocketRef s,
// in windows or tabs; all we must do is to specify which layout to
// use.
initialWindowLayout = layout;
// Change to directory of first file to open.
// NOTE: This is only done when Vim is starting to avoid confusion:
// if a window is already open the pwd is never touched.
if (openFiles && numFiles > 0 && ![args objectForKey:@"remoteID"])
{
char_u *s = [[filenames objectAtIndex:0] vimStringSave];
if (mch_isdir(s)) {
mch_chdir((char*)s);
} else {
vim_chdirfile(s);
}
vim_free(s);
}
}
} else {
// When Vim is already open we resort to some trickery to open the
+2 -2
View File
@@ -621,7 +621,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -651,7 +651,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",