summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0bf47e24d..d0479a5fb 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3139,8 +3139,13 @@ compile_def_function(
break;
case CMD_vim9script:
- emsg(_(e_vim9script_can_only_be_used_in_script));
- goto erret;
+ if (cctx.ctx_skip != SKIP_YES)
+ {
+ emsg(_(e_vim9script_can_only_be_used_in_script));
+ goto erret;
+ }
+ line = (char_u *)"";
+ break;
case CMD_global:
if (check_global_and_subst(ea.cmd, p) == FAIL)