Merge pull request #18421 from neovim/backport-18418-to-release-0.7

[Backport release-0.7] vim-patch:8.2.4865: :startinsert right after :stopinsert may not work
This commit is contained in:
zeertzjq
2022-05-05 07:21:55 +08:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -553,7 +553,7 @@ static int insert_check(VimState *state)
Insstart_orig = Insstart;
}
if (stop_insert_mode && !pum_visible()) {
if (stop_insert_mode && !compl_started) {
// ":stopinsert" used or 'insertmode' reset
s->count = 0;
return 0; // exit insert mode

View File

@@ -516,6 +516,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