diff options
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_prompt_buffer.vim | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/test/old/testdir/test_prompt_buffer.vim b/test/old/testdir/test_prompt_buffer.vim index b1288b4892..43d8bb4789 100644 --- a/test/old/testdir/test_prompt_buffer.vim +++ b/test/old/testdir/test_prompt_buffer.vim @@ -238,7 +238,7 @@ func Test_prompt_while_writing_to_hidden_buffer() \ done'], #{out_io: 'buffer', out_name: ''}) startinsert END - eval script->writefile(scriptName) + eval script->writefile(scriptName, 'D') let buf = RunVimInTerminal('-S ' .. scriptName, {}) call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))}) @@ -251,7 +251,44 @@ func Test_prompt_while_writing_to_hidden_buffer() call WaitForAssert({-> assert_equal('cmd:testtesttest', term_getline(buf, 1))}) call StopVimInTerminal(buf) - call delete(scriptName) +endfunc + +func Test_prompt_appending_while_hidden() + call CanTestPromptBuffer() + + let script =<< trim END + new prompt + set buftype=prompt + set bufhidden=hide + + func s:TextEntered(text) + if a:text == 'exit' + close + endif + echowin 'Entered:' a:text + endfunc + call prompt_setcallback(bufnr(), function('s:TextEntered')) + + func DoAppend() + call appendbufline('prompt', '$', 'Test') + endfunc + END + call writefile(script, 'XpromptBuffer', 'D') + + let buf = RunVimInTerminal('-S XpromptBuffer', {'rows': 10}) + call TermWait(buf) + + call term_sendkeys(buf, "asomething\<CR>") + call TermWait(buf) + + call term_sendkeys(buf, "exit\<CR>") + call TermWait(buf) + + call term_sendkeys(buf, ":call DoAppend()\<CR>") + call TermWait(buf) + call assert_notmatch('-- INSERT --', term_getline(buf, 10)) + + call StopVimInTerminal(buf) endfunc " vim: shiftwidth=2 sts=2 expandtab |