Patch 8.2.2284
Problem:    Vim9: cannot set an option to a boolean value.
Solution:   Check for VAR_BOOL. (closes #7603)
Files:      src/evalvars.c, src/testdir/test_vim9_builtin.vim


*** ../vim-8.2.2283/src/evalvars.c      2021-01-02 15:41:00.189079039 +0100
--- src/evalvars.c      2021-01-03 14:24:35.495587431 +0100
***************
*** 3508,3514 ****
      char_u    nbuf[NUMBUFLEN];
      int               error = FALSE;
  
!     if (!in_vim9script() || varp->v_type != VAR_STRING)
        numval = (long)tv_get_number_chk(varp, &error);
      strval = tv_get_string_buf_chk(varp, nbuf);
      if (!error && strval != NULL)
--- 3508,3516 ----
      char_u    nbuf[NUMBUFLEN];
      int               error = FALSE;
  
!     if (varp->v_type == VAR_BOOL)
!       numval = (long)varp->vval.v_number;
!     else if (!in_vim9script() || varp->v_type != VAR_STRING)
        numval = (long)tv_get_number_chk(varp, &error);
      strval = tv_get_string_buf_chk(varp, nbuf);
      if (!error && strval != NULL)
*** ../vim-8.2.2283/src/testdir/test_vim9_builtin.vim   2021-01-02 
15:41:00.193079024 +0100
--- src/testdir/test_vim9_builtin.vim   2021-01-03 14:45:56.347659337 +0100
***************
*** 652,662 ****
--- 652,670 ----
    &syntax->assert_equal('vim')
    setbufvar(bufnr('%'), '&ts', 16)
    &ts->assert_equal(16)
+   setbufvar(bufnr('%'), '&ai', true)
+   &ai->assert_equal(true)
+   setbufvar(bufnr('%'), '&ft', 'filetype')
+   &ft->assert_equal('filetype')
+ 
    settabwinvar(1, 1, '&syntax', 'vam')
    &syntax->assert_equal('vam')
    settabwinvar(1, 1, '&ts', 15)
    &ts->assert_equal(15)
    setlocal ts=8
+   settabwinvar(1, 1, '&list', true)
+   &list->assert_equal(true)
+   setlocal list&
  
    setbufvar('%', 'myvar', 123)
    getbufvar('%', 'myvar')->assert_equal(123)
*** ../vim-8.2.2283/src/version.c       2021-01-03 13:09:48.226390595 +0100
--- src/version.c       2021-01-03 14:26:05.111251784 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2284,
  /**/

-- 
You can't have everything.  Where would you put it?
                -- Steven Wright

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202101031347.103Dlvlh2132963%40masaka.moolenaar.net.

Raspunde prin e-mail lui