Skip to content

Commit aed702f

Browse files
committed
Fix a wait for channel I/O
1 parent 1710983 commit aed702f

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

src/MacVim/MMBackend.m

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -703,24 +703,14 @@ - (BOOL)waitForInput:(int)milliseconds
703703
forMode:NSDefaultRunLoopMode];
704704
}
705705

706-
CFAbsoluteTime lastTime =
707-
milliseconds >= 0 ? CFAbsoluteTimeGetCurrent() : .0;
708-
709706
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, dt, true)
710707
== kCFRunLoopRunHandledSource) {
711-
// In order to ensure that all input (except for channel) on the
712-
// run-loop has been processed we set the timeout to 0 and keep
713-
// processing until the run-loop times out.
714-
if ([inputQueue count] > 0 || input_available() || got_int) {
715-
dt = 0.0;
708+
// In order to ensure that all input on the run-loop has been
709+
// processed we set the timeout to 0 and keep processing until the
710+
// run-loop times out.
711+
dt = 0.0;
712+
if ([inputQueue count] > 0 || input_available() || got_int)
716713
inputReceived = YES;
717-
} else if (milliseconds >= 0) {
718-
CFAbsoluteTime nowTime = CFAbsoluteTimeGetCurrent();
719-
720-
if ((dt -= nowTime - lastTime) <= 0.0)
721-
break;
722-
lastTime = nowTime;
723-
}
724714
}
725715

726716
if ([inputQueue count] > 0 || input_available() || got_int)

0 commit comments

Comments
 (0)