aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-27 22:15:22 +0800
committerGitHub <noreply@github.com>2023-05-27 22:15:22 +0800
commitb46f61ac050e6eb530ceb4d4b510b612596427c5 (patch)
tree1bb67bdd0832024497d24d52c586b8461dd5a53e /test
parent510e1f131b56e0423342f597178459a63eb0b810 (diff)
downloadrneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.tar.gz
rneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.tar.bz2
rneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.zip
vim-patch:9.0.1582: :stopinsert may not work in a popup close handler (#23785)
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) https://github.com/vim/vim/commit/a40c0bcc83c32da02869f59b10538d6327df61c5
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_quickfix.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/old/testdir/test_quickfix.vim b/test/old/testdir/test_quickfix.vim
index f720b6e42d..156ce23d54 100644
--- a/test/old/testdir/test_quickfix.vim
+++ b/test/old/testdir/test_quickfix.vim
@@ -6280,5 +6280,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