1
0
forked from aniani/vim

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:
Bram Moolenaar
2020-12-28 18:26:00 +01:00
parent ed1e4c9a70
commit 9b8d62267f
13 changed files with 63 additions and 65 deletions

View File

@@ -304,7 +304,6 @@ static void ex_tag_cmd(exarg_T *eap, char_u *name);
# define ex_try ex_ni
# define ex_unlet ex_ni
# define ex_unlockvar ex_ni
# define ex_vim9script ex_ni
# define ex_while ex_ni
# define ex_import ex_ni
# define ex_export ex_ni
@@ -8011,10 +8010,9 @@ save_current_state(save_state_T *sst)
msg_scroll = FALSE; // no msg scrolling in Normal mode
restart_edit = 0; // don't go to Insert mode
p_im = FALSE; // don't use 'insertmode'
#ifdef FEAT_EVAL
sst->save_script_version = current_sctx.sc_version;
current_sctx.sc_version = 1; // not in Vim9 script
#endif
/*
* Save the current typeahead. This is required to allow using ":normal"
@@ -8038,9 +8036,7 @@ restore_current_state(save_state_T *sst)
opcount = sst->save_opcount;
reg_executing = sst->save_reg_executing;
msg_didout |= sst->save_msg_didout; // don't reset msg_didout now
#ifdef FEAT_EVAL
current_sctx.sc_version = sst->save_script_version;
#endif
// Restore the state (needed when called from a function executed for
// 'indentexpr'). Update the mouse and cursor, they may have changed.