API: better way to capture abort-causing non-exception errors

This condition is not perfectly reliable:
    (did_emsg && force_abort && !current_exception)

The more proper way to check for abort-causing non-exception errors is
to set up `msg_list` using the "pattern" given by do_cmdline().
This commit is contained in:
Justin M. Keyes
2018-05-09 03:02:12 +02:00
parent c9f3174075
commit 32b0470b03
4 changed files with 28 additions and 26 deletions

View File

@@ -6242,8 +6242,8 @@ bool set_ref_in_func(char_u *name, ufunc_T *fp_in, int copyID)
/// new_argcount = argv_func(current_argcount, argv, called_func_argcount)
///
/// @return FAIL if function cannot be called, else OK (even if an error
/// occurred while executing the function! Use `msg_first_ignored_err`
/// to get the error)
/// occurred while executing the function! Set `msg_list` to capture
/// the error, see do_cmdline()).
int
call_func(
const char_u *funcname, // name of the function