vim-patch:8.0.1246: popup test has an arbitrary delay

Problem:    Popup test has an arbitrary delay.
Solution:   Wait for the ruler to show. (James McCoy)
b315876efa
This commit is contained in:
Jan Edmund Lazo 2019-09-01 11:28:30 -04:00
parent 8e1adedb26
commit 8495e50273
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -669,9 +669,13 @@ func Test_popup_and_window_resize()
if h < 15 if h < 15
return return
endif endif
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3}) let rows = h / 3
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': rows})
call term_sendkeys(g:buf, (h / 3 - 1) . "o\<esc>") call term_sendkeys(g:buf, (h / 3 - 1) . "o\<esc>")
call term_wait(g:buf, 500) " Wait for the nested Vim to exit insert mode, where it will show the ruler.
" Need to trigger a redraw.
call WaitFor(printf('execute("redraw") == "" && term_getline(g:buf, %d) =~ "\\<%d,.*Bot"', rows, rows))
call term_sendkeys(g:buf, "Gi\<c-x>") call term_sendkeys(g:buf, "Gi\<c-x>")
call term_sendkeys(g:buf, "\<c-v>") call term_sendkeys(g:buf, "\<c-v>")
call term_wait(g:buf, 100) call term_wait(g:buf, 100)