From cd5dbad184e8235beb13dcd8a22302da09db9766 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 4 May 2022 17:51:50 +0100 Subject: [PATCH] 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) --- src/edit.c | 2 +- src/testdir/test_ins_complete.vim | 9 +++++++++ src/version.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) 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, /**/