From 1559b44fa36e920195325232cd8c67331e97a93d Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Fri, 10 Apr 2009 18:11:18 +0200 Subject: [PATCH] Fix Quickstart regression Output from a Vim process may reach the frontend even if the process is cached. Thus when processing input queues in the frontend, also check if the input came from a cached controller else it could be silently ignored. --- src/MacVim/MMAppController.m | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 70e59dc6..de6405a4 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -2148,7 +2148,8 @@ fsEventCallback(ConstFSEventStreamRef streamRef, NSDictionary *queues = inputQueues; inputQueues = [NSMutableDictionary new]; - // Pass each input queue on to the vim controller with matching identifier. + // Pass each input queue on to the vim controller with matching + // identifier (and note that it could be cached). NSEnumerator *e = [queues keyEnumerator]; NSNumber *key; while ((key = [e nextObject])) { @@ -2161,6 +2162,21 @@ fsEventCallback(ConstFSEventStreamRef streamRef, break; } } + + if (i < count) continue; + + count = [cachedVimControllers count]; + for (i = 0; i < count; ++i) { + MMVimController *vc = [cachedVimControllers objectAtIndex:i]; + if (ukey == [vc identifier]) { + [vc processInputQueue:[queues objectForKey:key]]; + break; + } + } + + if (i == count) + NSLog(@"[%s] WARNING: No Vim controller for identifier=%d", + _cmd, ukey); } [queues release]; -- 2.11.4.GIT