From: zeertzjq Date: Wed, 4 May 2022 16:51:50 +0000 (+0100) Subject: patch 8.2.4865: :startinsert right after :stopinsert may not work X-Git-Tag: v8.2.4865 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd5dbad184e8235beb13dcd8a22302da09db9766;p=thirdparty%2Fvim.git patch 8.2.4865: :startinsert right after :stopinsert may not work 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) --- 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 startinsert + inoremap stopinsert + " This just checks if this causes an error + call feedkeys("i\\\\", 'x') + nunmap + iunmap +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 @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4865, /**/ 4864, /**/