diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-27 14:10:08 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-27 14:10:08 +0100 |
commit | a40c0bcc83c32da02869f59b10538d6327df61c5 (patch) | |
tree | 324d7b8cf77e91910d71ae804b335a12dd0400ae /src/testdir/test_quickfix.vim | |
parent | a1d5f9f33c68d06475406d6f44d307d5e01adc01 (diff) |
patch 9.0.1582: :stopinsert may not work in a popup close handlerv9.0.1582
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution: Restore stop_insert_mode when appropriate. (closes #12452,
closes #12434)
Diffstat (limited to 'src/testdir/test_quickfix.vim')
-rw-r--r-- | src/testdir/test_quickfix.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index bc180fc04c..79c169273d 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -6404,5 +6404,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 |