Patch 8.2.4492
Problem:    No error if an option is given an invalid value with
            ":let &opt = val".
Solution:   Give the error. (closes #9864)
Files:      src/evalvars.c, src/testdir/test_options.vim


*** ../vim-8.2.4491/src/evalvars.c      2022-03-01 19:23:20.544357315 +0000
--- src/evalvars.c      2022-03-02 19:20:26.281055825 +0000
***************
*** 1518,1525 ****
        {
            if (opt_type != gov_string || s != NULL)
            {
!               set_option_value(arg, n, s, scope);
                arg_end = p;
            }
            else
                emsg(_(e_string_required));
--- 1518,1528 ----
        {
            if (opt_type != gov_string || s != NULL)
            {
!               char *err = set_option_value(arg, n, s, scope);
! 
                arg_end = p;
+               if (err != NULL)
+                   emsg(_(err));
            }
            else
                emsg(_(e_string_required));
*** ../vim-8.2.4491/src/testdir/test_options.vim        2022-02-22 
12:34:21.387356125 +0000
--- src/testdir/test_options.vim        2022-03-02 19:28:55.924529174 +0000
***************
*** 369,374 ****
--- 369,375 ----
    call assert_fails('set sidescroll=-1', 'E487:')
    call assert_fails('set tabstop=-1', 'E487:')
    call assert_fails('set tabstop=10000', 'E474:')
+   call assert_fails('let &tabstop = 10000', 'E474:')
    call assert_fails('set tabstop=5500000000', 'E474:')
    call assert_fails('set textwidth=-1', 'E487:')
    call assert_fails('set timeoutlen=-1', 'E487:')
***************
*** 384,389 ****
--- 385,391 ----
    call assert_fails('set comments=a', 'E525:')
    call assert_fails('set foldmarker=x', 'E536:')
    call assert_fails('set commentstring=x', 'E537:')
+   call assert_fails('let &commentstring = "x"', 'E537:')
    call assert_fails('set complete=x', 'E539:')
    call assert_fails('set rulerformat=%-', 'E539:')
    call assert_fails('set rulerformat=%(', 'E542:')
*** ../vim-8.2.4491/src/version.c       2022-03-02 17:34:52.156249510 +0000
--- src/version.c       2022-03-02 19:25:47.092723244 +0000
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     4492,
  /**/

-- 
Drink wet cement and get really stoned.

 /// 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/20220302195501.D12D71C04EA%40moolenaar.net.

Raspunde prin e-mail lui