mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Added support for 'wait' flag in sendMessage:data:wait:.
git-svn-id: http://macvim.googlecode.com/svn/trunk@24 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
+13
-2
@@ -160,8 +160,19 @@ static NSMenuItem *findMenuItemWithTagInMenu(NSMenu *root, int tag)
|
||||
- (void)sendMessage:(int)msgid data:(NSData *)data wait:(BOOL)wait
|
||||
{
|
||||
#if MM_USE_DO
|
||||
// TODO: Decrease reply/request timeouts if 'wait' is off.
|
||||
[backendProxy processInput:msgid data:data];
|
||||
if (wait) {
|
||||
[backendProxy processInput:msgid data:data];
|
||||
} else {
|
||||
// Do not wait for the message to be sent, i.e. drop the message if it
|
||||
// can't be delivered immediately.
|
||||
NSConnection *connection = [backendProxy connectionForProxy];
|
||||
if (connection) {
|
||||
NSTimeInterval req = [connection requestTimeout];
|
||||
[connection setRequestTimeout:0];
|
||||
[backendProxy processInput:msgid data:data];
|
||||
[connection setRequestTimeout:req];
|
||||
}
|
||||
}
|
||||
#else
|
||||
[NSPortMessage sendMessage:msgid withSendPort:sendPort data:data
|
||||
wait:wait];
|
||||
|
||||
Reference in New Issue
Block a user