@@ -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
@@ -591,8 +590,7 @@ func Test_terminal_no_cmd()
591590 else
592591 call system (' echo "look here" > ' . pty)
593592 endif
594- let g: buf = buf
595- call WaitFor (' term_getline(g:buf, 1) =~ "look here"' )
593+ call WaitFor ({- > term_getline (buf , 1 ) = ~ " look here" })
596594
597595 call assert_match (' look here' , term_getline (buf , 1 ))
598596 bwipe!
@@ -672,8 +670,7 @@ func TerminalTmap(remap)
672670 call assert_equal (' 456' , maparg (' 123' , ' t' ))
673671 call assert_equal (' abxde' , maparg (' 456' , ' t' ))
674672 call feedkeys (" 123" , ' tx' )
675- let g: buf = buf
676- call WaitFor (" term_getline(g:buf,term_getcursor(g:buf)[0]) =~ 'abxde\\ |456'" )
673+ call WaitFor ({- > term_getline (buf , term_getcursor (buf )[0 ]) = ~ ' abxde\|456' })
677674 let lnum = term_getcursor (buf )[0 ]
678675 if a: remap
679676 call assert_match (' abxde' , term_getline (buf , lnum))
@@ -816,12 +813,9 @@ func Test_terminal_response_to_control_sequence()
816813 endif
817814
818815 let buf = Run_shell_in_terminal ({})
819- call term_wait ( buf )
816+ call WaitFor ({ - > term_getline ( buf , 1 ) != " " } )
820817
821- new
822- call setline (1 , " \x1b [6n" )
823- write ! Xescape
824- bwipe
818+ call writefile ([" \x1b [6n" ], ' Xescape' )
825819 call term_sendkeys (buf , " cat Xescape\<cr> " )
826820
827821 " wait for the response of control sequence from libvterm (and send it to tty)
@@ -909,7 +903,7 @@ func Test_terminal_qall_prompt()
909903 quit
910904endfunc
911905
912- func Test_terminalopen_autocmd ()
906+ func Test_terminal_open_autocmd ()
913907 augroup repro
914908 au !
915909 au TerminalOpen * let s: called += 1
0 commit comments