diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-25 00:05:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-25 00:05:32 +0100 |
commit | 67a2deb9cb4ac2224cb1e4d240a5d0659f036264 (patch) | |
tree | 024c2f55f38fb92a7da3c6887dbd0c510c7ae6cb /src/evalfunc.c | |
parent | a106e6cde682bda4ad10ed745acb51975fcb02e0 (diff) |
patch 8.1.2341: not so easy to interrupt a script programaticallyv8.1.2341
Problem: Not so easy to interrupt a script programatically.
Solution: Add the interrupt() function. (Yasuhiro Matsumoto, closes #2834)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 6a9f9d6370..075ef1bf1b 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -114,6 +114,7 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv); static void f_inputrestore(typval_T *argvars, typval_T *rettv); static void f_inputsave(typval_T *argvars, typval_T *rettv); static void f_inputsecret(typval_T *argvars, typval_T *rettv); +static void f_interrupt(typval_T *argvars, typval_T *rettv); static void f_invert(typval_T *argvars, typval_T *rettv); static void f_islocked(typval_T *argvars, typval_T *rettv); #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) @@ -509,6 +510,7 @@ static funcentry_T global_functions[] = {"inputsave", 0, 0, 0, f_inputsave}, {"inputsecret", 1, 2, FEARG_1, f_inputsecret}, {"insert", 2, 3, FEARG_1, f_insert}, + {"interrupt", 0, 0, 0, f_interrupt}, {"invert", 1, 1, FEARG_1, f_invert}, {"isdirectory", 1, 1, FEARG_1, f_isdirectory}, #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) @@ -4152,6 +4154,15 @@ f_inputsecret(typval_T *argvars, typval_T *rettv) } /* + * "interrupt()" function + */ + static void +f_interrupt(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ + got_int = TRUE; +} + +/* * "invert(expr)" function */ static void |