comparison src/evalfunc.c @ 18699:1febd1aa9930 v8.1.2341

patch 8.1.2341: not so easy to interrupt a script programatically Commit: https://github.com/vim/vim/commit/67a2deb9cb4ac2224cb1e4d240a5d0659f036264 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 25 00:05:32 2019 +0100 patch 8.1.2341: not so easy to interrupt a script programatically Problem: Not so easy to interrupt a script programatically. Solution: Add the interrupt() function. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/2834)
author Bram Moolenaar <Bram@vim.org>
date Mon, 25 Nov 2019 00:15:06 +0100
parents 81d34044450f
children 128662297ddf
comparison
equal deleted inserted replaced
18698:13e7c756367c 18699:1febd1aa9930
112 static void f_inputdialog(typval_T *argvars, typval_T *rettv); 112 static void f_inputdialog(typval_T *argvars, typval_T *rettv);
113 static void f_inputlist(typval_T *argvars, typval_T *rettv); 113 static void f_inputlist(typval_T *argvars, typval_T *rettv);
114 static void f_inputrestore(typval_T *argvars, typval_T *rettv); 114 static void f_inputrestore(typval_T *argvars, typval_T *rettv);
115 static void f_inputsave(typval_T *argvars, typval_T *rettv); 115 static void f_inputsave(typval_T *argvars, typval_T *rettv);
116 static void f_inputsecret(typval_T *argvars, typval_T *rettv); 116 static void f_inputsecret(typval_T *argvars, typval_T *rettv);
117 static void f_interrupt(typval_T *argvars, typval_T *rettv);
117 static void f_invert(typval_T *argvars, typval_T *rettv); 118 static void f_invert(typval_T *argvars, typval_T *rettv);
118 static void f_islocked(typval_T *argvars, typval_T *rettv); 119 static void f_islocked(typval_T *argvars, typval_T *rettv);
119 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) 120 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
120 static void f_isinf(typval_T *argvars, typval_T *rettv); 121 static void f_isinf(typval_T *argvars, typval_T *rettv);
121 static void f_isnan(typval_T *argvars, typval_T *rettv); 122 static void f_isnan(typval_T *argvars, typval_T *rettv);
507 {"inputlist", 1, 1, FEARG_1, f_inputlist}, 508 {"inputlist", 1, 1, FEARG_1, f_inputlist},
508 {"inputrestore", 0, 0, 0, f_inputrestore}, 509 {"inputrestore", 0, 0, 0, f_inputrestore},
509 {"inputsave", 0, 0, 0, f_inputsave}, 510 {"inputsave", 0, 0, 0, f_inputsave},
510 {"inputsecret", 1, 2, FEARG_1, f_inputsecret}, 511 {"inputsecret", 1, 2, FEARG_1, f_inputsecret},
511 {"insert", 2, 3, FEARG_1, f_insert}, 512 {"insert", 2, 3, FEARG_1, f_insert},
513 {"interrupt", 0, 0, 0, f_interrupt},
512 {"invert", 1, 1, FEARG_1, f_invert}, 514 {"invert", 1, 1, FEARG_1, f_invert},
513 {"isdirectory", 1, 1, FEARG_1, f_isdirectory}, 515 {"isdirectory", 1, 1, FEARG_1, f_isdirectory},
514 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) 516 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
515 {"isinf", 1, 1, FEARG_1, f_isinf}, 517 {"isinf", 1, 1, FEARG_1, f_isinf},
516 #endif 518 #endif
4150 --cmdline_star; 4152 --cmdline_star;
4151 --inputsecret_flag; 4153 --inputsecret_flag;
4152 } 4154 }
4153 4155
4154 /* 4156 /*
4157 * "interrupt()" function
4158 */
4159 static void
4160 f_interrupt(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
4161 {
4162 got_int = TRUE;
4163 }
4164
4165 /*
4155 * "invert(expr)" function 4166 * "invert(expr)" function
4156 */ 4167 */
4157 static void 4168 static void
4158 f_invert(typval_T *argvars, typval_T *rettv) 4169 f_invert(typval_T *argvars, typval_T *rettv)
4159 { 4170 {