summaryrefslogtreecommitdiff
path: root/src/testdir/test_prompt_buffer.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_prompt_buffer.vim')
-rw-r--r--src/testdir/test_prompt_buffer.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_prompt_buffer.vim b/src/testdir/test_prompt_buffer.vim
index 32ed21e64..8918bd47f 100644
--- a/src/testdir/test_prompt_buffer.vim
+++ b/src/testdir/test_prompt_buffer.vim
@@ -39,6 +39,10 @@ func WriteScript(name)
\ ' set nomodified',
\ 'endfunc',
\ '',
+ \ 'func SwitchWindows()',
+ \ ' call timer_start(0, {-> execute("wincmd p|wincmd p", "")})',
+ \ 'endfunc',
+ \ '',
\ 'call setline(1, "other buffer")',
\ 'set nomodified',
\ 'new',
@@ -99,6 +103,27 @@ func Test_prompt_editing()
call delete(scriptName)
endfunc
+func Test_prompt_switch_windows()
+ call CanTestPromptBuffer()
+ let scriptName = 'XpromptSwitchWindows'
+ call WriteScript(scriptName)
+
+ let buf = RunVimInTerminal('-S ' . scriptName, {'rows': 12})
+ call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})
+ call WaitForAssert({-> assert_match('-- INSERT --', term_getline(buf, 12))})
+
+ call term_sendkeys(buf, "\<C-O>:call SwitchWindows()\<CR>")
+ call term_wait(buf, 50)
+ call WaitForAssert({-> assert_match('-- INSERT --', term_getline(buf, 12))})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call term_wait(buf, 50)
+ call WaitForAssert({-> assert_match('^ *$', term_getline(buf, 12))})
+
+ call StopVimInTerminal(buf)
+ call delete(scriptName)
+endfunc
+
func Test_prompt_garbage_collect()
func MyPromptCallback(x, text)
" NOP