@@ -373,18 +373,22 @@ func Test_swap_prompt_splitwin()
373373 call WaitForAssert ({- > assert_match (' ^1$' , term_getline (buf , 20 ))})
374374 call StopVimInTerminal (buf )
375375
376- " This caused Vim to crash when typing "q".
377- " TODO: it does not actually reproduce the crash.
378- call writefile ([' au BufAdd * set virtualedit=all' ], ' Xvimrc' )
379-
380- let buf = RunVimInTerminal (' -u Xvimrc Xfile1' , {' rows' : 20 , ' wait_for_ruler' : 0 })
381- call TermWait (buf )
382- call WaitForAssert ({- > assert_match (' ^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:' , term_getline (buf , 20 ))})
376+ " This caused Vim to crash when typing "q" at the swap file prompt.
377+ let buf = RunVimInTerminal (' -c "au bufadd * let foo_w = wincol()"' , {' rows' : 18 })
378+ call term_sendkeys (buf , " :e Xfile1\<CR> " )
379+ call WaitForAssert ({- > assert_match (' More' , term_getline (buf , 18 ))})
380+ call term_sendkeys (buf , " " )
381+ call WaitForAssert ({- > assert_match (' ^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:' , term_getline (buf , 18 ))})
383382 call term_sendkeys (buf , " q" )
383+ call TermWait (buf )
384+ " check that Vim is still running
385+ call term_sendkeys (buf , " :echo 'hello'\<CR> " )
386+ call WaitForAssert ({- > assert_match (' ^hello' , term_getline (buf , 18 ))})
387+ call term_sendkeys (buf , " :%bwipe!\<CR> " )
388+ call StopVimInTerminal (buf )
384389
385390 % bwipe!
386391 call delete (' Xfile1' )
387- call delete (' Xvimrc' )
388392endfunc
389393
390394func Test_swap_symlink ()
0 commit comments