comparison 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
comparison
equal deleted inserted replaced
15978:c036f95274c6 15979:72987a858c96
4809 static void 4809 static void
4810 f_getchar(typval_T *argvars, typval_T *rettv) 4810 f_getchar(typval_T *argvars, typval_T *rettv)
4811 { 4811 {
4812 varnumber_T n; 4812 varnumber_T n;
4813 int error = FALSE; 4813 int error = FALSE;
4814 int save_reg_executing = reg_executing;
4814 4815
4815 #ifdef MESSAGE_QUEUE 4816 #ifdef MESSAGE_QUEUE
4816 // vpeekc() used to check for messages, but that caused problems, invoking 4817 // vpeekc() used to check for messages, but that caused problems, invoking
4817 // a callback where it was not expected. Some plugins use getchar(1) in a 4818 // a callback where it was not expected. Some plugins use getchar(1) in a
4818 // loop to await a message, therefore make sure we check for messages here. 4819 // loop to await a message, therefore make sure we check for messages here.
4843 continue; 4844 continue;
4844 break; 4845 break;
4845 } 4846 }
4846 --no_mapping; 4847 --no_mapping;
4847 --allow_keys; 4848 --allow_keys;
4849 reg_executing = save_reg_executing;
4848 4850
4849 set_vim_var_nr(VV_MOUSE_WIN, 0); 4851 set_vim_var_nr(VV_MOUSE_WIN, 0);
4850 set_vim_var_nr(VV_MOUSE_WINID, 0); 4852 set_vim_var_nr(VV_MOUSE_WINID, 0);
4851 set_vim_var_nr(VV_MOUSE_LNUM, 0); 4853 set_vim_var_nr(VV_MOUSE_LNUM, 0);
4852 set_vim_var_nr(VV_MOUSE_COL, 0); 4854 set_vim_var_nr(VV_MOUSE_COL, 0);