Mercurial > vim
diff src/term.c @ 13379:0f9dd1b43244
patch 8.0.1563: timeout of getwinposx() can be too short
commit https://github.com/vim/vim/commit/3f54fd319f6641b4bed478bcc90cdb39ede68e31
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 3 21:29:55 2018 +0100
patch 8.0.1563: timeout of getwinposx() can be too short
Problem: Timeout of getwinposx() can be too short. (lilydjwg)
Solution: Add getwinpos(). (closes https://github.com/vim/vim/issues/2689)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 03 Mar 2018 21:30:06 +0100 |
parents | c6bafddbfa33 |
children | 69517d67421f |
line wrap: on
line diff
--- a/src/term.c +++ b/src/term.c @@ -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)