Problem: Stoping Vim running in a terminal may not work.
Solution: Instead of sending <Esc> send CTRL-O.
" Stop a Vim running in terminal buffer "buf".
func StopVimInTerminal(buf)
call assert_equal("running", term_getstatus(a:buf))
- call term_sendkeys(a:buf, "\<Esc>:qa!\<cr>")
+
+ " CTRL-O : works both in Normal mode and Insert mode to start a command line.
+ " In Command-line it's inserted, the CTRL-U removes it again.
+ call term_sendkeys(a:buf, "\<C-O>\<C-U>:qa!\<cr>")
+
call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))})
only!
endfunc
\ 'func TimerFunc(text)',
\ ' " Add the output above the current prompt.',
\ ' call append(line("$") - 1, "Result: \"" . a:text . "\"")',
+ \ ' " Reset &modified to allow the buffer to be closed.',
+ \ ' set nomodified',
\ 'endfunc',
\ '',
\ 'call setline(1, "other buffer")',
+ \ 'set nomodified',
\ 'new',
\ 'set buftype=prompt',
\ 'call prompt_setcallback(bufnr(""), function("TextEntered"))',
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 30,
/**/
29,
/**/