diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-13 18:19:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-13 18:19:55 +0000 |
commit | 3b309f11db7904efcae0177c2825597042c07427 (patch) | |
tree | b48818c5f228e2c113380459785db3c81973aeb3 /src/userfunc.c | |
parent | 1e78deb0779bc403a914712f0842a65d2949dfdf (diff) | |
download | vim-git-3b309f11db7904efcae0177c2825597042c07427.tar.gz |
patch 8.2.3798: a :def callback function postpones an error messagev8.2.3798
Problem: A :def callback function postpones an error message.
Solution: Display the error after calling the function. (closes #9340)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index da33ba0c7..cc921f5a1 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; } |