0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3798: a :def callback function postpones an error message

Problem:    A :def callback function postpones an error message.
Solution:   Display the error after calling the function. (closes #9340)
This commit is contained in:
Bram Moolenaar
2021-12-13 18:19:55 +00:00
parent 1e78deb077
commit 3b309f11db
4 changed files with 65 additions and 10 deletions

View File

@@ -3173,6 +3173,15 @@ call_callback(
++callback_depth;
ret = call_func(callback->cb_name, len, rettv, argcount, argvars, &funcexe);
--callback_depth;
// When a :def function was called that uses :try an error would be turned
// into an exception. Need to give the error here.
if (need_rethrow && current_exception != NULL)
{
need_rethrow = FALSE;
handle_did_throw();
}
return ret;
}