diff src/scriptfile.c @ 24874:14b0b35d8488 v8.2.2975

patch 8.2.2975: Vim9: can only use an autoload function name as a string Commit: https://github.com/vim/vim/commit/f0a4069e3df904ac6bd57718ec06e56c5d7363e4 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 11 22:05:47 2021 +0200 patch 8.2.2975: Vim9: can only use an autoload function name as a string Problem: Vim9: can only use an autoload function name as a string. Solution: Load the autoload script when encountered. (closes https://github.com/vim/vim/issues/8124)
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Jun 2021 22:15:03 +0200
parents 524120691c3d
children c4ad84c7e15f
line wrap: on
line diff
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -1128,6 +1128,7 @@ do_source(
     proftime_T		    wait_start;
 #endif
     int			    trigger_source_post = FALSE;
+    int			    save_estack_compiling = estack_compiling;
     ESTACK_CHECK_DECLARATION
 
     p = expand_env_save(fname);
@@ -1142,6 +1143,7 @@ do_source(
 	smsg(_("Cannot source a directory: \"%s\""), fname);
 	goto theend;
     }
+    estack_compiling = FALSE;
 
 #ifdef FEAT_EVAL
     // See if we loaded this script before.
@@ -1508,6 +1510,7 @@ almosttheend:
 
 theend:
     vim_free(fname_exp);
+    estack_compiling = save_estack_compiling;
     return retval;
 }