patch 8.2.0960: cannot use :import in legacy Vim script
Problem: Cannot use :import in legacy Vim script.
Solution: Support :import in any Vim script.
diff --git a/src/vim9script.c b/src/vim9script.c
index fa0f8c6..ca14702 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -17,7 +17,7 @@
#include "vim9.h"
-static char e_needs_vim9[] = N_("E1042: import/export can only be used in vim9script");
+static char e_needs_vim9[] = N_("E1042: export can only be used in vim9script");
int
in_vim9script(void)
@@ -141,16 +141,10 @@
void
ex_import(exarg_T *eap)
{
- if (current_sctx.sc_version != SCRIPT_VERSION_VIM9)
- emsg(_(e_needs_vim9));
- else
- {
- char_u *cmd_end = handle_import(eap->arg, NULL,
- current_sctx.sc_sid, NULL);
+ char_u *cmd_end = handle_import(eap->arg, NULL, current_sctx.sc_sid, NULL);
- if (cmd_end != NULL)
- eap->nextcmd = check_nextcmd(cmd_end);
- }
+ if (cmd_end != NULL)
+ eap->nextcmd = check_nextcmd(cmd_end);
}
/*