# HG changeset patch # User Bram Moolenaar # Date 1585497604 -7200 # Node ID 9981509b665fea3c13684a836fdab2fd11eefdfb # Parent 95aa315cc31d3a5a9222daff2dac736a2631302e patch 8.2.0476: terminal nasty callback test fails sometimes Commit: https://github.com/vim/vim/commit/52ea92b19d2bc992dd4570add64c12d98eab9db2 Author: Bram Moolenaar Date: Sun Mar 29 17:50:48 2020 +0200 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 https://github.com/vim/vim/issues/5865) diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -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\") + let altbuf = bufnr('#') + call term_sendkeys(altbuf, "exit\") + call term_wait(altbuf) call popup_close(win_getid()) endfunc call OpenTerms() call term_sendkeys(g:buf0, "exit\") - sleep 100m + call term_wait(g:buf0, 100) exe g:buf0 .. 'bwipe!' set hidden& endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 476, +/**/ 475, /**/ 474,