@@ -2245,17 +2245,19 @@ func Test_autocmd_SafeState()
22452245 call writefile (lines , ' XSafeState' )
22462246 let buf = RunVimInTerminal (' -S XSafeState' , #{rows: 6 })
22472247
2248- " Sometimes we loop to handle an K_IGNORE
2248+ " Sometimes we loop to handle a K_IGNORE, SafeState may be trigered once or
2249+ " more often.
22492250 call term_sendkeys (buf , " :echo g:safe\<CR> " )
2250- call WaitForAssert ({- > assert_match (' ^[12] ' , term_getline (buf , 6 ))}, 1000 )
2251+ call WaitForAssert ({- > assert_match (' ^\d ' , term_getline (buf , 6 ))}, 1000 )
22512252
2253+ " SafeStateAgain should be invoked at least three times
22522254 call term_sendkeys (buf , " :echo g:again\<CR> " )
2253- call WaitForAssert ({- > assert_match (' ^xxxx ' , term_getline (buf , 6 ))}, 1000 )
2255+ call WaitForAssert ({- > assert_match (' ^xxx ' , term_getline (buf , 6 ))}, 1000 )
22542256
22552257 call term_sendkeys (buf , " :let g:again = ''\<CR> :call CallTimer()\<CR> " )
2256- call term_wait (buf , 50 )
2258+ call term_wait (buf , 100 )
22572259 call term_sendkeys (buf , " :\<CR> " )
2258- call term_wait (buf , 50 )
2260+ call term_wait (buf , 100 )
22592261 call term_sendkeys (buf , " :echo g:again\<CR> " )
22602262 call WaitForAssert ({- > assert_match (' xtx' , term_getline (buf , 6 ))}, 1000 )
22612263
0 commit comments