summaryrefslogtreecommitdiffstats
path: root/src/autocmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-28 18:26:00 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-28 18:26:00 +0100
commit9b8d62267f583d5dc042920adb1de046959ad11d (patch)
tree8a2c9ab0af5fee27b1acfb6b707045d2b4bf898f /src/autocmd.c
parented1e4c9a70aaa7de56bac23e75a846e874a32a56 (diff)
patch 8.2.2238: Vim9: cannot load a Vim9 script without the +eval featurev8.2.2238
Problem: Vim9: cannot load a Vim9 script without the +eval feature. Solution: Support Vim9 script syntax without the +eval feature.
Diffstat (limited to 'src/autocmd.c')
-rw-r--r--src/autocmd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index c3aa324b34..f7ca41de44 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -55,9 +55,7 @@ typedef struct AutoCmd
char once; // "One shot": removed after execution
char nested; // If autocommands nest here.
char last; // last command in list
-#ifdef FEAT_EVAL
sctx_T script_ctx; // script context where defined
-#endif
struct AutoCmd *next; // next AutoCmd in list
} AutoCmd;
@@ -1249,8 +1247,8 @@ do_autocmd_event(
if (ac == NULL)
return FAIL;
ac->cmd = vim_strsave(cmd);
-#ifdef FEAT_EVAL
ac->script_ctx = current_sctx;
+#ifdef FEAT_EVAL
ac->script_ctx.sc_lnum += SOURCING_LNUM;
#endif
if (ac->cmd == NULL)
@@ -1819,8 +1817,8 @@ apply_autocmds_group(
static int nesting = 0;
AutoPatCmd patcmd;
AutoPat *ap;
-#ifdef FEAT_EVAL
sctx_T save_current_sctx;
+#ifdef FEAT_EVAL
funccal_entry_T funccal_entry;
char_u *save_cmdarg;
long save_cmdbang;
@@ -2029,9 +2027,9 @@ apply_autocmds_group(
estack_push(ETYPE_AUCMD, NULL, 0);
ESTACK_CHECK_SETUP
-#ifdef FEAT_EVAL
save_current_sctx = current_sctx;
+#ifdef FEAT_EVAL
# ifdef FEAT_PROFILE
if (do_profiling == PROF_YES)
prof_child_enter(&wait_time); // doesn't count for the caller itself
@@ -2138,8 +2136,8 @@ apply_autocmds_group(
autocmd_fname_full = save_autocmd_fname_full;
autocmd_bufnr = save_autocmd_bufnr;
autocmd_match = save_autocmd_match;
-#ifdef FEAT_EVAL
current_sctx = save_current_sctx;
+#ifdef FEAT_EVAL
restore_funccal();
# ifdef FEAT_PROFILE
if (do_profiling == PROF_YES)
@@ -2370,9 +2368,7 @@ getnextac(
if (ac->once)
au_del_cmd(ac);
autocmd_nested = ac->nested;
-#ifdef FEAT_EVAL
current_sctx = ac->script_ctx;
-#endif
if (ac->last)
acp->nextcmd = NULL;
else