From fdd289b215e531850c83879bd702e1996d5c4ac0 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Thu, 30 Sep 2010 12:25:54 +0200 Subject: [PATCH] Shorter input check intervals --- src/MacVim/gui_macvim.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index a808e3892f..e02c03f617 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -248,13 +248,17 @@ gui_mch_update(void) // here to avoid reduced frame-rates but then it would not be possible to // interrupt Vim by presssing Ctrl-C during lengthy operations (e.g. after // entering "10gs" it would not be possible to bring Vim out of the 10 s - // sleep prematurely). As a compromise we check for Ctrl-C only once per - // second. Note that Cmd-. sends SIGINT so it has higher success rate at - // interrupting Vim. + // sleep prematurely). Furthermore, Vim sometimes goes into a loop waiting + // for keyboard input (e.g. during a "more prompt") where not checking for + // input could cause Vim to lock up indefinitely. + // + // As a compromise we check for new input only every now and then. Note + // that Cmd-. sends SIGINT so it has higher success rate at interrupting + // Vim than Ctrl-C. static CFAbsoluteTime lastTime = 0; CFAbsoluteTime nowTime = CFAbsoluteTimeGetCurrent(); - if (nowTime - lastTime > 1.0) { + if (nowTime - lastTime > 0.2) { [[MMBackend sharedInstance] update]; lastTime = nowTime; }