0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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.
This commit is contained in:
Bram Moolenaar
2020-06-11 23:10:46 +02:00
parent 00e260bb6c
commit 9721fb4ea3
5 changed files with 90 additions and 24 deletions

View File

@@ -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 @@ free_imports(int sid)
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);
}
/*