Mercurial > vim
diff src/vim9compile.c @ 27575:9f70df0b2967 v8.2.4314
patch 8.2.4314: test fails where lines are skipped
Commit: https://github.com/vim/vim/commit/8cbf2499179db39a46e700ab04d0b36e22bcc1bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 6 20:28:13 2022 +0000
patch 8.2.4314: test fails where lines are skipped
Problem: Test fails where lines are skipped.
Solution: Only give an error when not skipping commands.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Feb 2022 21:30:02 +0100 |
parents | 55f0ac079829 |
children | 8c7836f8668d |
line wrap: on
line diff
--- 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)