Patch 8.2.3021
Problem:    Spaces allowed between option name and "!", "?", etc.
Solution:   Disallow spaces in Vim9 script, it was not documented.
            (closes #8408)
Files:      src/option.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3020/src/option.c        2021-06-13 20:27:32.889357660 +0200

--- src/option.c        2021-06-20 12:35:10.403855328 +0200
***************
*** 1306,1314 ****
            // remember character after option name
            afterchar = arg[len];
  
!           // skip white space, allow ":set ai  ?"
!           while (VIM_ISWHITE(arg[len]))
!               ++len;
  
            adding = FALSE;
            prepending = FALSE;
--- 1306,1315 ----
            // remember character after option name
            afterchar = arg[len];
  
!           if (!in_vim9script())
!               // skip white space, allow ":set ai  ?", ":set hlsearch  !"
!               while (VIM_ISWHITE(arg[len]))
!                   ++len;
  
            adding = FALSE;
            prepending = FALSE;
*** ../vim-8.2.3020/src/testdir/test_vim9_script.vim    2021-06-17 
22:08:13.376738576 +0200
--- src/testdir/test_vim9_script.vim    2021-06-20 12:38:40.823105963 +0200
***************
*** 3937,3942 ****
--- 3937,3962 ----
    delfunc g:FuncA
  enddef
  
+ def Test_option_modifier()
+   var lines =<< trim END
+       set hlsearch &  hlsearch  !
+       call assert_equal(1, &hlsearch)
+   END
+   CheckScriptSuccess(lines)
+ 
+   lines =<< trim END
+       vim9script
+       set hlsearch &
+   END
+   CheckScriptFailure(lines, 'E518:')
+ 
+   lines =<< trim END
+       vim9script
+       set hlsearch &  hlsearch  !
+   END
+   CheckScriptFailure(lines, 'E518:')
+ enddef
+ 
  " Keep this last, it messes up highlighting.
  def Test_substitute_cmd()
    new
*** ../vim-8.2.3020/src/version.c       2021-06-19 21:38:21.728726296 +0200
--- src/version.c       2021-06-20 12:29:04.341266041 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     3021,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother... she doesn't have VOIP

 /// 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/202106201040.15KAeRcW268881%40masaka.moolenaar.net.

Raspunde prin e-mail lui