1
0
forked from aniani/vim

patch 8.0.1563: timeout of getwinposx() can be too short

Problem:    Timeout of getwinposx() can be too short. (lilydjwg)
Solution:   Add getwinpos(). (closes #2689)
This commit is contained in:
Bram Moolenaar
2018-03-03 21:29:55 +01:00
parent 71137fed4d
commit 3f54fd319f
5 changed files with 55 additions and 10 deletions

View File

@@ -2789,7 +2789,7 @@ static int waiting_for_winpos = FALSE;
* Returns OK or FAIL.
*/
int
term_get_winpos(int *x, int *y)
term_get_winpos(int *x, int *y, varnumber_T timeout)
{
int count = 0;
@@ -2801,8 +2801,8 @@ term_get_winpos(int *x, int *y)
OUT_STR(T_CGP);
out_flush();
/* Try reading the result for 100 msec. */
while (count++ < 10)
/* Try reading the result for "timeout" msec. */
while (count++ < timeout / 10)
{
(void)vpeekc_nomap();
if (winpos_x >= 0 && winpos_y >= 0)