diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-26 15:10:56 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-26 15:10:56 +0100 |
commit | 6809ff978a5c5b798952db9fa663df9e1776f3ff (patch) | |
tree | b0821fea1f29dbcc37110b62234ac8c2fda045b5 /src/vim9compile.c | |
parent | 559f230fd618e51d7986d87217ff38a2eac73cef (diff) | |
download | vim-git-6809ff978a5c5b798952db9fa663df9e1776f3ff.tar.gz |
patch 9.0.0079: error in autoload script not reported for 'foldexpr'v9.0.0079
Problem: Error in autoload script not reported for 'foldexpr'.
Solution: Reset "emsg_off" when auto-loading a script. (closes #10685)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index b7f590e10..c6316367e 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -610,12 +610,20 @@ find_imported(char_u *name, size_t len, int load) ret = find_imported_in_script(name, len, current_sctx.sc_sid); if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD)) { - scid_T dummy; + scid_T dummy; + int save_emsg_off = emsg_off; + + // "emsg_off" will be set when evaluating an expression silently, but + // we do want to know about errors in a script. Also because it then + // aborts when an error is encountered. + emsg_off = FALSE; // script found before but not loaded yet ret->imp_flags &= ~IMP_FLAGS_AUTOLOAD; (void)do_source(SCRIPT_ITEM(ret->imp_sid)->sn_name, FALSE, DOSO_NONE, &dummy); + + emsg_off = save_emsg_off; } return ret; } |