diff src/evalfunc.c @ 15979:72987a858c96 v8.1.0995

patch 8.1.0995: a getchar() call resets the reg_executing() result commit https://github.com/vim/vim/commit/f0fab3046c2b5c4115979347464a802853011220 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 5 12:24:10 2019 +0100 patch 8.1.0995: a getchar() call resets the reg_executing() result Problem: A getchar() call while executing a register resets the reg_executing() result. Solution: Save and restore reg_executing. (closes #406
author Bram Moolenaar <Bram@vim.org>
date Tue, 05 Mar 2019 12:30:08 +0100
parents 7fbdceabad64
children e91750e8adb5
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4811,6 +4811,7 @@ f_getchar(typval_T *argvars, typval_T *r
 {
     varnumber_T		n;
     int			error = FALSE;
+    int			save_reg_executing = reg_executing;
 
 #ifdef MESSAGE_QUEUE
     // vpeekc() used to check for messages, but that caused problems, invoking
@@ -4845,6 +4846,7 @@ f_getchar(typval_T *argvars, typval_T *r
     }
     --no_mapping;
     --allow_keys;
+    reg_executing = save_reg_executing;
 
     set_vim_var_nr(VV_MOUSE_WIN, 0);
     set_vim_var_nr(VV_MOUSE_WINID, 0);