Patch 8.2.4314 (after 8.2.4312)
Problem:    Test fails where lines are skipped.
Solution:   Only give an error when not skipping commands.
Files:      src/vim9compile.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.4313/src/vim9compile.c   2022-02-06 17:30:37.697660685 +0000
--- src/vim9compile.c   2022-02-06 20:27:30.163398973 +0000
***************
*** 3139,3146 ****
                    break;
  
            case CMD_vim9script:
!                   emsg(_(e_vim9script_can_only_be_used_in_script));
!                   goto erret;
  
            case CMD_global:
                    if (check_global_and_subst(ea.cmd, p) == FAIL)
--- 3139,3151 ----
                    break;
  
            case CMD_vim9script:
!                   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)
*** ../vim-8.2.4313/src/testdir/test_vim9_script.vim    2022-02-06 
17:30:37.697660685 +0000
--- src/testdir/test_vim9_script.vim    2022-02-06 20:26:28.303447839 +0000
***************
*** 1228,1233 ****
--- 1228,1238 ----
  
    assert_fails('vim9script', 'E1038:')
    v9.CheckDefFailure(['vim9script'], 'E1038:')
+ 
+   # no error when skipping
+   if has('nothing')
+     vim9script
+   endif
  enddef
  
  def Test_script_var_shadows_function()
*** ../vim-8.2.4313/src/version.c       2022-02-06 18:36:46.297746545 +0000
--- src/version.c       2022-02-06 20:25:34.367489630 +0000
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4314,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
    you don't have a clue when it happened.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220206202855.50E3E1C071D%40moolenaar.net.

Raspunde prin e-mail lui