mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
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)
67a2deb9cb
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user