diff src/cmdexpand.c @ 28427:96d53065f309 v8.2.4738

patch 8.2.4738: Esc on commandline executes command instead of abandoning it Commit: https://github.com/vim/vim/commit/11a57dfd16a47f248fe949344bd5db3f12b9bd32 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 11 19:38:56 2022 +0100 patch 8.2.4738: Esc on commandline executes command instead of abandoning it Problem: Esc on commandline executes command instead of abandoning it. Solution: Save and restore KeyTyped when removing the popup menu. (closes #10154)
author Bram Moolenaar <Bram@vim.org>
date Mon, 11 Apr 2022 20:45:02 +0200
parents 813660733869
children add09d468c0d
line wrap: on
line diff
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -378,6 +378,7 @@ int cmdline_pum_active(void)
 void cmdline_pum_remove(void)
 {
     int save_p_lz = p_lz;
+    int	save_KeyTyped = KeyTyped;
 
     pum_undisplay();
     VIM_CLEAR(compl_match_array);
@@ -385,6 +386,10 @@ void cmdline_pum_remove(void)
     update_screen(0);
     p_lz = save_p_lz;
     redrawcmd();
+
+    // When a function is called (e.g. for 'foldtext') KeyTyped might be reset
+    // as a side effect.
+    KeyTyped = save_KeyTyped;
 }
 
 void cmdline_pum_cleanup(cmdline_info_T *cclp)