0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

patch 8.2.0476: terminal nasty callback test fails sometimes

Problem:    Terminal nasty callback test fails sometimes.
Solution:   use term_wait() instead of a sleep. (Yee Cheng Chin,closes #5865)
This commit is contained in:
Bram Moolenaar 2020-03-29 17:50:48 +02:00
parent bf54dbeb5c
commit 52ea92b19d
2 changed files with 7 additions and 3 deletions

View File

@ -2536,17 +2536,19 @@ func Test_term_nasty_callback()
let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
call popup_create(g:buf1, {})
let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
sleep 100m
call term_wait(g:buf2, 100)
call popup_close(win_getid())
endfunc
func TermExit(...)
call term_sendkeys(bufnr('#'), "exit\<CR>")
let altbuf = bufnr('#')
call term_sendkeys(altbuf, "exit\<CR>")
call term_wait(altbuf)
call popup_close(win_getid())
endfunc
call OpenTerms()
call term_sendkeys(g:buf0, "exit\<CR>")
sleep 100m
call term_wait(g:buf0, 100)
exe g:buf0 .. 'bwipe!'
set hidden&
endfunc

View File

@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
476,
/**/
475,
/**/