mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
General cleanup
git-svn-id: http://macvim.googlecode.com/svn/trunk@232 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
@@ -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;
|
||||
|
||||
+4
-52
@@ -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 <MMVimServerProtocol>)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];
|
||||
|
||||
+6
-1
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ char *MessageStrings[] =
|
||||
"SetMouseShapeMsgID",
|
||||
"AdjustLinespaceMsgID",
|
||||
"ActivateMsgID",
|
||||
"ServerAddInputMsgID",
|
||||
"SetServerNameMsgID",
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user