@@ -432,39 +432,38 @@ func Test_terminal_servername()
432432 if ! has (' clientserver' )
433433 return
434434 endif
435- let g: buf = Run_shell_in_terminal ({})
435+ let buf = Run_shell_in_terminal ({})
436436 " Wait for the shell to display a prompt
437- call WaitFor (' term_getline(g: buf, 1) != ""' )
437+ call WaitFor ({ - > term_getline (buf , 1 ) != " " } )
438438 if has (' win32' )
439- call term_sendkeys (g: buf , " echo %VIM_SERVERNAME%\r " )
439+ call term_sendkeys (buf , " echo %VIM_SERVERNAME%\r " )
440440 else
441- call term_sendkeys (g: buf , " echo $VIM_SERVERNAME\r " )
441+ call term_sendkeys (buf , " echo $VIM_SERVERNAME\r " )
442442 endif
443- call term_wait (g: buf )
444- call Stop_shell_in_terminal (g: buf )
443+ call term_wait (buf )
444+ call Stop_shell_in_terminal (buf )
445445 call WaitFor (' getline(2) == v:servername' )
446446 call assert_equal (v: servername , getline (2 ))
447447
448- exe g: buf . ' bwipe'
449- unlet g: buf
448+ exe buf . ' bwipe'
449+ unlet buf
450450endfunc
451451
452452func Test_terminal_env ()
453- let g: buf = Run_shell_in_terminal ({' env' : {' TESTENV' : ' correct' }})
453+ let buf = Run_shell_in_terminal ({' env' : {' TESTENV' : ' correct' }})
454454 " Wait for the shell to display a prompt
455- call WaitFor (' term_getline(g: buf, 1) != ""' )
455+ call WaitFor ({ - > term_getline (buf , 1 ) != " " } )
456456 if has (' win32' )
457- call term_sendkeys (g: buf , " echo %TESTENV%\r " )
457+ call term_sendkeys (buf , " echo %TESTENV%\r " )
458458 else
459- call term_sendkeys (g: buf , " echo $TESTENV\r " )
459+ call term_sendkeys (buf , " echo $TESTENV\r " )
460460 endif
461- call term_wait (g: buf )
462- call Stop_shell_in_terminal (g: buf )
461+ call term_wait (buf )
462+ call Stop_shell_in_terminal (buf )
463463 call WaitFor (' getline(2) == "correct"' )
464464 call assert_equal (' correct' , getline (2 ))
465465
466- exe g: buf . ' bwipe'
467- unlet g: buf
466+ exe buf . ' bwipe'
468467endfunc
469468
470469" must be last, we can't go back from GUI to terminal
@@ -596,8 +595,7 @@ func Test_terminal_no_cmd()
596595 else
597596 call system (' echo "look here" > ' . pty)
598597 endif
599- let g: buf = buf
600- call WaitFor (' term_getline(g:buf, 1) =~ "look here"' )
598+ call WaitFor ({- > term_getline (buf , 1 ) = ~ " look here" })
601599
602600 call assert_match (' look here' , term_getline (buf , 1 ))
603601 bwipe!
@@ -677,8 +675,7 @@ func TerminalTmap(remap)
677675 call assert_equal (' 456' , maparg (' 123' , ' t' ))
678676 call assert_equal (' abxde' , maparg (' 456' , ' t' ))
679677 call feedkeys (" 123" , ' tx' )
680- let g: buf = buf
681- call WaitFor (" term_getline(g:buf,term_getcursor(g:buf)[0]) =~ 'abxde\\ |456'" )
678+ call WaitFor ({- > term_getline (buf , term_getcursor (buf )[0 ]) = ~ ' abxde\|456' })
682679 let lnum = term_getcursor (buf )[0 ]
683680 if a: remap
684681 call assert_match (' abxde' , term_getline (buf , lnum))
@@ -826,12 +823,9 @@ func Test_terminal_response_to_control_sequence()
826823 endif
827824
828825 let buf = Run_shell_in_terminal ({})
829- call term_wait ( buf )
826+ call WaitFor ({ - > term_getline ( buf , 1 ) != " " } )
830827
831- new
832- call setline (1 , " \x1b [6n" )
833- write ! Xescape
834- bwipe
828+ call writefile ([" \x1b [6n" ], ' Xescape' )
835829 call term_sendkeys (buf , " cat Xescape\<cr> " )
836830
837831 " wait for the response of control sequence from libvterm (and send it to tty)
@@ -919,7 +913,7 @@ func Test_terminal_qall_prompt()
919913 quit
920914endfunc
921915
922- func Test_terminalopen_autocmd ()
916+ func Test_terminal_open_autocmd ()
923917 augroup repro
924918 au !
925919 au TerminalOpen * let s: called += 1
0 commit comments