mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
vim-patch:9.0.1582: :stopinsert may not work in a popup close handler
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson) Solution: Restore stop_insert_mode when appropriate. (closes vim/vim#12452, closes vim/vim#12434)a40c0bcc83(cherry picked from commita9d6bc7082)
This commit is contained in:
committed by
github-actions[bot]
parent
b5a66b1830
commit
eaacdd059e
@@ -6292,5 +6292,28 @@ func Test_setqflist_cb_arg()
|
||||
call setqflist([], 'f')
|
||||
endfunc
|
||||
|
||||
" Test that setqflist() should not prevent :stopinsert from working
|
||||
func Test_setqflist_stopinsert()
|
||||
new
|
||||
call setqflist([], 'f')
|
||||
copen
|
||||
cclose
|
||||
func StopInsert()
|
||||
stopinsert
|
||||
call setqflist([{'text': 'foo'}])
|
||||
return ''
|
||||
endfunc
|
||||
|
||||
call setline(1, 'abc')
|
||||
call cursor(1, 1)
|
||||
call feedkeys("i\<C-R>=StopInsert()\<CR>$", 'tnix')
|
||||
call assert_equal('foo', getqflist()[0].text)
|
||||
call assert_equal([0, 1, 3, 0, v:maxcol], getcurpos())
|
||||
call assert_equal(['abc'], getline(1, '$'))
|
||||
|
||||
delfunc StopInsert
|
||||
call setqflist([], 'f')
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user