vim-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 vim/vim#406
f0fab3046c
This commit is contained in:
Jan Edmund Lazo
2019-05-26 20:50:54 -04:00
parent 21f160746a
commit 2393611588
2 changed files with 23 additions and 0 deletions

View File

@@ -9673,6 +9673,7 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
varnumber_T n;
bool error = false;
const int save_reg_executing = reg_executing;
no_mapping++;
for (;; ) {
@@ -9709,6 +9710,7 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
break;
}
no_mapping--;
reg_executing = save_reg_executing;
vimvars[VV_MOUSE_WIN].vv_nr = 0;
vimvars[VV_MOUSE_WINID].vv_nr = 0;