mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
vim-patch:9.0.1443: ending Insert mode when accessing a hidden prompt buffer (#22984)
Problem: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closes vim/vim#12237)
05a627c3d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -271,6 +271,7 @@ func Test_prompt_appending_while_hidden()
|
||||
|
||||
func DoAppend()
|
||||
call appendbufline('prompt', '$', 'Test')
|
||||
return ''
|
||||
endfunc
|
||||
END
|
||||
call writefile(script, 'XpromptBuffer', 'D')
|
||||
@@ -283,11 +284,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
|
||||
|
||||
|
Reference in New Issue
Block a user