Skip to content

Commit 52ea92b

Browse files
committed
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)
1 parent bf54dbe commit 52ea92b

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/testdir/test_terminal.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,17 +2536,19 @@ func Test_term_nasty_callback()
25362536
let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
25372537
call popup_create(g:buf1, {})
25382538
let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
2539-
sleep 100m
2539+
call term_wait(g:buf2, 100)
25402540
call popup_close(win_getid())
25412541
endfunc
25422542
func TermExit(...)
2543-
call term_sendkeys(bufnr('#'), "exit\<CR>")
2543+
let altbuf = bufnr('#')
2544+
call term_sendkeys(altbuf, "exit\<CR>")
2545+
call term_wait(altbuf)
25442546
call popup_close(win_getid())
25452547
endfunc
25462548
call OpenTerms()
25472549

25482550
call term_sendkeys(g:buf0, "exit\<CR>")
2549-
sleep 100m
2551+
call term_wait(g:buf0, 100)
25502552
exe g:buf0 .. 'bwipe!'
25512553
set hidden&
25522554
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
476,
741743
/**/
742744
475,
743745
/**/

0 commit comments

Comments
 (0)