From ef2628baf9f283ba54e315f7a23df151409e1704 Mon Sep 17 00:00:00 2001 From: "bjorn.winckler" Date: Thu, 13 Sep 2007 19:27:20 +0000 Subject: [PATCH] General cleanup git-svn-id: http://macvim.googlecode.com/svn/trunk@232 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMAppController.m | 28 ---------------------------- MMBackend.m | 56 ++++--------------------------------------------------- MMTextView.m | 7 ++++++- MacVim.h | 4 ---- MacVim.m | 1 - README | 6 +++--- 6 files changed, 13 insertions(+), 89 deletions(-) diff --git a/MMAppController.m b/MMAppController.m index 906c5d41..4c6c8b45 100644 --- a/MMAppController.m +++ b/MMAppController.m @@ -441,36 +441,8 @@ static NSTimeInterval MMTerminateTimeout = 3; unsigned i, count = [vimControllers count]; for (i = 0; i < count; ++i) { MMVimController *controller = [vimControllers objectAtIndex:i]; -#if 0 - id proxy = [controller backendProxy]; - NSConnection *connection = [proxy connectionForProxy]; - if (!connection) - continue; - - // Set low timeouts since we don't want this call to potentially lock - // up MacVim for a while. - NSTimeInterval req = [connection requestTimeout]; - NSTimeInterval rep = [connection replyTimeout]; - [connection setRequestTimeout:0]; - [connection setReplyTimeout:.1]; - - @try { - NSString *eval = [proxy evaluateExpression:@"v:servername"]; - if (eval) { - [array addObject:eval]; - } - } - @catch (NSException *e) { - NSLog(@"WARNING: Got exception while listing servers: \"%@\"", e); - } - @finally { - [connection setRequestTimeout:req]; - [connection setReplyTimeout:rep]; - } -#else if ([controller serverName]) [array addObject:[controller serverName]]; -#endif } return array; diff --git a/MMBackend.m b/MMBackend.m index a19b2699..3c8741e7 100644 --- a/MMBackend.m +++ b/MMBackend.m @@ -1053,21 +1053,6 @@ enum { return NO; } -#if 0 -- (NSString *)evaluateExpression:(in bycopy NSString *)expr -{ - NSString *eval = nil; - char_u *res = eval_client_expr_to_string((char_u*)[expr UTF8String]); - - if (res != NULL) { - eval = [NSString stringWithUTF8String:(char*)res]; - vim_free(res); - } - - return eval; -} -#endif - - (oneway void)addReply:(in bycopy NSString *)reply server:(in byref id )server { @@ -1132,6 +1117,8 @@ enum { if ([svrConn registerName:connName]) { //NSLog(@"Registered server with name: %@", svrName); + // TODO: Set request/reply time-outs to something else? + // // Don't wait for requests (time-out means that the message is // dropped). [svrConn setRequestTimeout:0]; @@ -1651,12 +1638,6 @@ enum { const void *bytes = [data bytes]; int shape = *((int*)bytes); bytes += sizeof(int); update_mouseshape(shape); - } else if (ServerAddInputMsgID == msgid) { - const void *bytes = [data bytes]; - /*int len = *((int*)bytes);*/ bytes += sizeof(int); - char_u *cmd = (char_u*)bytes; - - server_to_input_buf(cmd); } else { NSLog(@"WARNING: Unknown message received (msgid=%d)", msgid); } @@ -1833,13 +1814,6 @@ enum { } #endif -#if 0 // This does not work...for now, just don't care if a focus msg was lost. - // HACK! A focus message might get lost, but whenever we get here the GUI - // is in focus. - if (!gui.in_focus) - [self focusChange:TRUE]; -#endif - inputReceived = YES; inProcessInput = NO; } @@ -1861,26 +1835,6 @@ enum { if (!svrConn) { svrConn = [NSConnection connectionWithRegisteredName:connName host:nil]; -#if 0 - if (!svrConn && [name length] > 0) { - unichar lastChar = [name characterAtIndex:[name length]-1]; - if (lastChar < '0' && lastChar > '9') { - // No connection for 'name' exists, and 'name' does not end - // with a digit, so try to find connection with name 'name%d'. - int i; - for (i = 1; i <= 10; ++i) { - NSString *altName = [NSString stringWithFormat:@"%@%d", - connName, i]; - svrConn = [NSConnection - connectionWithRegisteredName:altName host:nil]; - if (svrConn) { - connName = altName; - break; - } - } - } - } -#else // Try alternate server... if (!svrConn && alternateServerName) { //NSLog(@" trying to connect to alternate server: %@", @@ -1892,7 +1846,7 @@ enum { // Try looking for alternate servers... if (!svrConn) { - NSLog(@" looking for alternate servers..."); + //NSLog(@" looking for alternate servers..."); NSString *alt = [self alternateServerNameForName:name]; if (alt != alternateServerName) { //NSLog(@" found alternate server: %@", string); @@ -1910,8 +1864,6 @@ enum { host:nil]; } -#endif - if (svrConn) { [connectionNameDict setObject:svrConn forKey:connName]; @@ -1994,7 +1946,7 @@ enum { return nil; // Filter out servers starting with 'name' and ending with a number. The - // (?i) pattern ensures that the match case insensitive. + // (?i) pattern ensures that the match is case insensitive. NSString *pat = [NSString stringWithFormat:@"(?i)%@[0-9]+\\z", name]; NSPredicate *pred = [NSPredicate predicateWithFormat: @"SELF MATCHES %@", pat]; diff --git a/MMTextView.m b/MMTextView.m index 27afcd2b..4e9c9847 100644 --- a/MMTextView.m +++ b/MMTextView.m @@ -245,7 +245,12 @@ static float MMDragAreaSize = 73.0f; #if 0 // Confused note to self: Why did I implement this in the first place? Will -// something break if I don't? Input methods that use arrow keys do not work +// something break if I don't? +// +// Answer: Cmd-letter key strokes are consumed by the menu (regardless if they +// are bound to a menu item or not) and never passed on to Vim. +// +// Input methods that use arrow keys do not work // properly with this implementation, so it is disabled for now. - (BOOL)performKeyEquivalent:(NSEvent *)event { diff --git a/MacVim.h b/MacVim.h index f9628783..08fb9ee1 100644 --- a/MacVim.h +++ b/MacVim.h @@ -35,9 +35,6 @@ - (BOOL)checkForModifiedBuffers; - (oneway void)setDialogReturn:(in bycopy id)obj; - (BOOL)starRegisterToPasteboard:(byref NSPasteboard *)pboard; -#if 0 -- (NSString *)evaluateExpression:(in bycopy NSString *)expr; -#endif @end @@ -154,7 +151,6 @@ enum { SetMouseShapeMsgID, AdjustLinespaceMsgID, ActivateMsgID, - ServerAddInputMsgID, SetServerNameMsgID, }; diff --git a/MacVim.m b/MacVim.m index 7cf09ea3..4c2d7f4b 100644 --- a/MacVim.m +++ b/MacVim.m @@ -58,7 +58,6 @@ char *MessageStrings[] = "SetMouseShapeMsgID", "AdjustLinespaceMsgID", "ActivateMsgID", - "ServerAddInputMsgID", "SetServerNameMsgID", }; diff --git a/README b/README index 17334b8c..386ba7cb 100644 --- a/README +++ b/README @@ -159,8 +159,8 @@ Features (!supp indicates that a feature is not supported): (but not 'tooltip' which is always on), each window has its own toolbar, custom toolbar items - Cocoa input protocols: input managers, character palette input etc. - supported, marked text !supp, cocoa key bindings (DefaultKeyBinding.dict) - are disabled + supported, marked text partially supported, cocoa key bindings + (DefaultKeyBinding.dict) are disabled - Mouse: resize (vim) windows, selection, different mouse cursors, autoscrolling whilst selecting (horizontal autoscroll !supp) - Drag and Drop: drag files onto dock icon to open in tabs, drag text and files @@ -185,4 +185,4 @@ Features (!supp indicates that a feature is not supported): - Encodings: !supp (enc, tenc always set to utf-8) - Autosave window position - Smart cascading of new windows -- Partial client/server support +- Client/server support (only gui window can become server) -- 2.11.4.GIT