Mercurial > vim
comparison src/os_win32.c @ 23060:ab8a9b9bd349 v8.2.2076
patch 8.2.2076: MS-Windows console: sometimes drops typed characters
Commit: https://github.com/vim/vim/commit/c478ee3d83fab0dba46740f2023c35f743f88316
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 1 21:27:51 2020 +0100
patch 8.2.2076: MS-Windows console: sometimes drops typed characters
Problem: MS-Windows console: sometimes drops typed characters.
Solution: Do not wait longer than 10 msec for input. (issue https://github.com/vim/vim/issues/7164)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 01 Dec 2020 21:30:04 +0100 |
parents | 3b476f974406 |
children | fb27d3a7a24b |
comparison
equal
deleted
inserted
replaced
23059:6a5d5797613f | 23060:ab8a9b9bd349 |
---|---|
1586 } | 1586 } |
1587 if (msec != 0) | 1587 if (msec != 0) |
1588 { | 1588 { |
1589 DWORD dwWaitTime = dwEndTime - dwNow; | 1589 DWORD dwWaitTime = dwEndTime - dwNow; |
1590 | 1590 |
1591 # ifdef FEAT_JOB_CHANNEL | 1591 // Don't wait for more than 11 msec to avoid dropping characters, |
1592 // Check channel while waiting for input. | 1592 // check channel while waiting for input and handle a callback from |
1593 if (dwWaitTime > 100) | 1593 // 'balloonexpr'. |
1594 { | 1594 if (dwWaitTime > 11) |
1595 dwWaitTime = 100; | 1595 dwWaitTime = 11; |
1596 // If there is readahead then parse_queued_messages() timed out | 1596 |
1597 // and we should call it again soon. | |
1598 if (channel_any_readahead()) | |
1599 dwWaitTime = 10; | |
1600 } | |
1601 # endif | |
1602 # ifdef FEAT_BEVAL_GUI | |
1603 if (p_beval && dwWaitTime > 100) | |
1604 // The 'balloonexpr' may indirectly invoke a callback while | |
1605 // waiting for a character, need to check often. | |
1606 dwWaitTime = 100; | |
1607 # endif | |
1608 # ifdef FEAT_MZSCHEME | 1597 # ifdef FEAT_MZSCHEME |
1609 if (mzthreads_allowed() && p_mzq > 0 | 1598 if (mzthreads_allowed() && p_mzq > 0 && (long)dwWaitTime > p_mzq) |
1610 && (msec < 0 || (long)dwWaitTime > p_mzq)) | |
1611 dwWaitTime = p_mzq; // don't wait longer than 'mzquantum' | 1599 dwWaitTime = p_mzq; // don't wait longer than 'mzquantum' |
1612 # endif | 1600 # endif |
1613 # ifdef FEAT_TIMERS | 1601 # ifdef FEAT_TIMERS |
1614 // When waiting very briefly don't trigger timers. | 1602 // When waiting very briefly don't trigger timers. |
1615 if (dwWaitTime > 10) | 1603 if (dwWaitTime > 10) |