1
0
forked from aniani/vim

patch 9.0.1443: ending Insert mode when accessing a hidden prompt buffer

Problem:    Ending Insert mode when accessing a hidden prompt buffer.
Solution:   Don't stop Insert mode when it was active before. (closes #12237)
This commit is contained in:
Bram Moolenaar
2023-04-09 22:01:31 +01:00
parent bfc7cbd1d4
commit 05a627c3d4
4 changed files with 19 additions and 0 deletions

View File

@@ -270,6 +270,7 @@ func Test_prompt_appending_while_hidden()
func DoAppend()
call appendbufline('prompt', '$', 'Test')
return ''
endfunc
END
call writefile(script, 'XpromptBuffer', 'D')
@@ -282,11 +283,21 @@ func Test_prompt_appending_while_hidden()
call term_sendkeys(buf, "exit\<CR>")
call TermWait(buf)
call assert_notmatch('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, ":call DoAppend()\<CR>")
call TermWait(buf)
call assert_notmatch('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "i")
call TermWait(buf)
call assert_match('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "\<C-R>=DoAppend()\<CR>")
call TermWait(buf)
call assert_match('-- INSERT --', term_getline(buf, 10))
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
endfunc