From cd2f7e9eb17d35fbaf63ada2778f0e8eb72ab520 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Fri, 13 Jun 2008 19:01:56 +0200 Subject: [PATCH] Flush output queue even when 'exiting' flag is set There are legitimate instances when the queue should flush even though Vim is exiting, e.g. to display a 'confirm quit' dialog with 'go+=c'. This patch has the negative side-effect that the "dropping DO message" warning may occur more frequently. Another fix for this problem has to be devised. --- src/MacVim/MMBackend.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index 91a8e098ae..21c84ed55b 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -462,10 +462,9 @@ static NSString *MMSymlinkWarningString = // NOTE! This method gets called a lot; if we were to flush every time it // got called MacVim would feel unresponsive. So there is a time out which // ensures that the queue isn't flushed too often. - if (exiting || - (!force && lastFlushDate && - -[lastFlushDate timeIntervalSinceNow] < MMFlushTimeoutInterval && - [drawData length] < MMFlushQueueLenHint)) + if (!force && lastFlushDate + && -[lastFlushDate timeIntervalSinceNow] < MMFlushTimeoutInterval + && [drawData length] < MMFlushQueueLenHint) return; if ([drawData length] > 0) { @@ -1847,6 +1846,9 @@ static NSString *MMSymlinkWarningString = - (void)queueMessage:(int)msgid data:(NSData *)data { + //if (msgid != EnableMenuItemMsgID) + // NSLog(@"queueMessage:%s", MessageStrings[msgid]); + [outputQueue addObject:[NSData dataWithBytes:&msgid length:sizeof(int)]]; if (data) [outputQueue addObject:data];