mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.2238: Vim9: cannot load a Vim9 script without the +eval feature
Problem: Vim9: cannot load a Vim9 script without the +eval feature. Solution: Support Vim9 script syntax without the +eval feature.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user