diff src/edit.c @ 22427:58cdc5d7f143 v8.2.1762

patch 8.2.1762: when a timer uses :stopinsert completion isn't stopped Commit: https://github.com/vim/vim/commit/d0e1b7103c14eb0d175c6b245b4b6ed93a204da9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 27 20:13:03 2020 +0200 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).
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Sep 2020 20:15:03 +0200
parents 6941d3205be9
children fba5ccf33794
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -587,8 +587,11 @@ edit(
 		if (stop_insert_mode)
 		{
 		    // Insert mode ended, possibly from a callback.
+		    if (c != K_IGNORE && c != K_NOP)
+			vungetc(c);
 		    count = 0;
 		    nomove = TRUE;
+		    ins_compl_prep(ESC);
 		    goto doESCkey;
 		}
 	    } while (c == K_IGNORE || c == K_NOP);