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:
zeertzjq
2023-04-10 07:33:26 +08:00
committed by GitHub
parent 71225228fc
commit d52cc668c7
4 changed files with 24 additions and 0 deletions

View File

@@ -247,6 +247,7 @@ describe('prompt buffer', function()
func DoAppend()
call appendbufline('prompt', '$', 'Test')
return ''
endfunc
]])
feed('asomething<CR>')
@@ -254,7 +255,12 @@ describe('prompt buffer', function()
neq(prev_win, meths.get_current_win())
feed('exit<CR>')
eq(prev_win, meths.get_current_win())
eq({ mode = 'n', blocking = false }, meths.get_mode())
command('call DoAppend()')
eq({ mode = 'n', blocking = false }, meths.get_mode())
feed('i')
eq({ mode = 'i', blocking = false }, meths.get_mode())
command('call DoAppend()')
eq({ mode = 'i', blocking = false }, meths.get_mode())
end)
end)