comparison src/vim9compile.c @ 29475:fab3a46d0af7 v9.0.0079

patch 9.0.0079: error in autoload script not reported for 'foldexpr' Commit: https://github.com/vim/vim/commit/6809ff978a5c5b798952db9fa663df9e1776f3ff Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 26 15:10:56 2022 +0100 patch 9.0.0079: error in autoload script not reported for 'foldexpr' Problem: Error in autoload script not reported for 'foldexpr'. Solution: Reset "emsg_off" when auto-loading a script. (closes https://github.com/vim/vim/issues/10685)
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 Jul 2022 16:15:03 +0200
parents 49d8b54802f3
children 495dc54392fa
comparison
equal deleted inserted replaced
29474:1101803eb1fa 29475:fab3a46d0af7
608 return NULL; 608 return NULL;
609 609
610 ret = find_imported_in_script(name, len, current_sctx.sc_sid); 610 ret = find_imported_in_script(name, len, current_sctx.sc_sid);
611 if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD)) 611 if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD))
612 { 612 {
613 scid_T dummy; 613 scid_T dummy;
614 int save_emsg_off = emsg_off;
615
616 // "emsg_off" will be set when evaluating an expression silently, but
617 // we do want to know about errors in a script. Also because it then
618 // aborts when an error is encountered.
619 emsg_off = FALSE;
614 620
615 // script found before but not loaded yet 621 // script found before but not loaded yet
616 ret->imp_flags &= ~IMP_FLAGS_AUTOLOAD; 622 ret->imp_flags &= ~IMP_FLAGS_AUTOLOAD;
617 (void)do_source(SCRIPT_ITEM(ret->imp_sid)->sn_name, FALSE, 623 (void)do_source(SCRIPT_ITEM(ret->imp_sid)->sn_name, FALSE,
618 DOSO_NONE, &dummy); 624 DOSO_NONE, &dummy);
625
626 emsg_off = save_emsg_off;
619 } 627 }
620 return ret; 628 return ret;
621 } 629 }
622 630
623 /* 631 /*