diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-08-03 16:25:12 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-08-14 18:20:28 -0400 |
commit | 0680b5218e29f2ebb947d61210d8775ff720f8bb (patch) | |
tree | 1beb49afbaaf709eaa23d4c8e27c623852a95aba /src/nvim/ex_eval.c | |
parent | 6d68b2801bf74573980b8c1af9871ead001cb922 (diff) | |
download | rneovim-0680b5218e29f2ebb947d61210d8775ff720f8bb.tar.gz rneovim-0680b5218e29f2ebb947d61210d8775ff720f8bb.tar.bz2 rneovim-0680b5218e29f2ebb947d61210d8775ff720f8bb.zip |
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
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 81274fcf2a..e99e5b01cd 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -87,17 +87,16 @@ */ static int cause_abort = FALSE; -/* - * Return TRUE when immediately aborting on error, or when an interrupt - * occurred or an exception was thrown but not caught. Use for ":{range}call" - * to check whether an aborted function that does not handle a range itself - * should be called again for the next line in the range. Also used for - * cancelling expression evaluation after a function call caused an immediate - * abort. Note that the first emsg() call temporarily resets "force_abort" - * until the throw point for error messages has been reached. That is, during - * cancellation of an expression evaluation after an aborting function call or - * due to a parsing error, aborting() always returns the same value. - */ +// Return true when immediately aborting on error, or when an interrupt +// occurred or an exception was thrown but not caught. Use for ":{range}call" +// to check whether an aborted function that does not handle a range itself +// should be called again for the next line in the range. Also used for +// cancelling expression evaluation after a function call caused an immediate +// abort. Note that the first emsg() call temporarily resets "force_abort" +// until the throw point for error messages has been reached. That is, during +// cancellation of an expression evaluation after an aborting function call or +// due to a parsing error, aborting() always returns the same value. +// "got_int" is also set by calling interrupt(). int aborting(void) { return (did_emsg && force_abort) || got_int || current_exception; |