To: vim_dev@googlegroups.com Subject: Patch 7.4.1584 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1584 Problem: Timers don't work for Win32 console. Solution: Add check_due_timer() in WaitForChar(). Files: src/os_win32.c *** ../vim-7.4.1583/src/os_win32.c 2016-03-11 22:52:00.742438030 +0100 --- src/os_win32.c 2016-03-15 23:04:34.400428604 +0100 *************** *** 214,220 **** static void visual_bell(void); static void cursor_visible(BOOL fVisible); static DWORD write_chars(char_u *pchBuf, DWORD cbToWrite); - static WCHAR tgetch(int *pmodifiers, WCHAR *pch2); static void create_conin(void); static int s_cursor_visible = TRUE; static int did_create_conin = FALSE; --- 214,219 ---- *************** *** 1502,1507 **** --- 1501,1521 ---- && (msec < 0 || (long)dwWaitTime > p_mzq)) dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */ #endif + #ifdef FEAT_TIMERS + { + long due_time; + + /* When waiting very briefly don't trigger timers. */ + if (dwWaitTime > 10) + { + /* Trigger timers and then get the time in msec until the + * next one is due. Wait up to that time. */ + due_time = check_due_timer(); + if (due_time > 0 && dwWaitTime > (DWORD)due_time) + dwWaitTime = due_time; + } + } + #endif #ifdef FEAT_CLIENTSERVER /* Wait for either an event on the console input or a message in * the client-server window. */ *************** *** 1604,1610 **** } /* ! * Get a keystroke or a mouse event */ static WCHAR tgetch(int *pmodifiers, WCHAR *pch2) --- 1618,1624 ---- } /* ! * Get a keystroke or a mouse event, use a blocking wait. */ static WCHAR tgetch(int *pmodifiers, WCHAR *pch2) *************** *** 6074,6080 **** /* ! * Delay for half a second. */ /*ARGSUSED*/ void --- 6088,6094 ---- /* ! * Delay for "msec" milliseconds. */ /*ARGSUSED*/ void *** ../vim-7.4.1583/src/version.c 2016-03-16 23:24:39.894387868 +0100 --- src/version.c 2016-03-17 17:58:19.741777199 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1584, /**/ -- hundred-and-one symptoms of being an internet addict: 62. If your doorbell rings, you think that new mail has arrived. And then you're disappointed that it's only someone at the door. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///