From 8e945c2524f26e019959e82072e783cdaa694818 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 15 Jan 2022 22:33:16 +0800 Subject: vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped Problem: When a timer uses :stopinsert Insert mode completion isn't stopped. (Stanley Chan) Solution: Call ins_compl_prep(ESC). https://github.com/vim/vim/commit/d0e1b7103c14eb0d175c6b245b4b6ed93a204da9 --- src/nvim/edit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/edit.c') diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 9efe5a27c4..23e555c6de 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -663,8 +663,12 @@ static int insert_execute(VimState *state, int key) InsertState *const s = (InsertState *)state; if (stop_insert_mode) { // Insert mode ended, possibly from a callback. + if (key != K_IGNORE && key != K_NOP) { + vungetc(key); + } s->count = 0; s->nomove = true; + ins_compl_prep(ESC); return 0; } -- cgit