diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-04 17:51:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-04 17:51:50 +0100 |
commit | cd5dbad184e8235beb13dcd8a22302da09db9766 (patch) | |
tree | de46398f8bc6cedcfb855133822614bb06993f2d | |
parent | 0395f88b84b8917aeff1f7026cf968de0f55ba22 (diff) |
patch 8.2.4865: :startinsert right after :stopinsert may not workv8.2.4865
Problem: :startinsert right after :stopinsert does not work when popup menu
is still visible.
Solution: Use ins_compl_active() instead of pum_visible(). (closes #10352)
-rw-r--r-- | src/edit.c | 2 | ||||
-rw-r--r-- | src/testdir/test_ins_complete.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c index 61c1694836..65b760ba04 100644 --- a/src/edit.c +++ b/src/edit.c @@ -448,7 +448,7 @@ edit( if (update_Insstart_orig) Insstart_orig = Insstart; - if (stop_insert_mode && !pum_visible()) + if (stop_insert_mode && !ins_compl_active()) { // ":stopinsert" used or 'insertmode' reset count = 0; diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 75ec03cb37..6bb499701b 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -555,6 +555,15 @@ func Test_pum_stopped_by_timer() call delete('Xpumscript') endfunc +func Test_complete_stopinsert_startinsert() + nnoremap <F2> <Cmd>startinsert<CR> + inoremap <F2> <Cmd>stopinsert<CR> + " This just checks if this causes an error + call feedkeys("i\<C-X>\<C-N>\<F2>\<F2>", 'x') + nunmap <F2> + iunmap <F2> +endfunc + func Test_pum_with_folds_two_tabs() CheckScreendump diff --git a/src/version.c b/src/version.c index 19223239a7..bf2c8dc7cf 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4865, +/**/ 4864, /**/ 4863, |