From 0680b5218e29f2ebb947d61210d8775ff720f8bb Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 3 Aug 2020 16:25:12 -0400 Subject: vim-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 vim/vim#2834) https://github.com/vim/vim/commit/67a2deb9cb4ac2224cb1e4d240a5d0659f036264 --- src/nvim/eval/funcs.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/eval/funcs.c') diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 1a80d4d4bd..a81f789f0f 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -4717,6 +4717,14 @@ static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } +// "interrupt()" function +static void f_interrupt(typval_T *argvars FUNC_ATTR_UNUSED, + typval_T *rettv FUNC_ATTR_UNUSED, + FunPtr fptr FUNC_ATTR_UNUSED) +{ + got_int = true; +} + /* * "invert(expr)" function */ -- cgit