Patch 8.2.1592
Problem:    Vim9: passing "true" to char2nr() fails.
Solution:   Use tv_get_bool_chk(). (closes #6865)
Files:      src/evalfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1591/src/evalfunc.c      2020-09-04 16:35:06.425571289 +0200
--- src/evalfunc.c      2020-09-04 19:50:19.196771965 +0200
***************
*** 1710,1716 ****
        int     utf8 = 0;
  
        if (argvars[1].v_type != VAR_UNKNOWN)
!           utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
  
        if (utf8)
            rettv->vval.v_number = utf_ptr2char(tv_get_string(&argvars[0]));
--- 1710,1716 ----
        int     utf8 = 0;
  
        if (argvars[1].v_type != VAR_UNKNOWN)
!           utf8 = (int)tv_get_bool_chk(&argvars[1], NULL);
  
        if (utf8)
            rettv->vval.v_number = utf_ptr2char(tv_get_string(&argvars[0]));
*** ../vim-8.2.1591/src/testdir/test_vim9_func.vim      2020-09-04 
18:35:23.544429716 +0200
--- src/testdir/test_vim9_func.vim      2020-09-04 19:45:45.681387083 +0200
***************
*** 1339,1344 ****
--- 1339,1348 ----
    assert_equal(5, col([1, '$']))
  enddef
  
+ def Test_char2nr()
+   assert_equal(12354, char2nr('あ', true))
+ enddef
+ 
  def Test_getreg_return_type()
    let s1: string = getreg('"')
    let s2: string = getreg('"', 1)
*** ../vim-8.2.1591/src/version.c       2020-09-04 18:38:02.719910414 +0200
--- src/version.c       2020-09-04 19:50:32.548741067 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1592,
  /**/

-- 
ARTHUR:  I am your king!
WOMAN:   Well, I didn't vote for you.
ARTHUR:  You don't vote for kings.
WOMAN:   Well, 'ow did you become king then?
                                  The Quest for the Holy Grail (Monty Python)

 /// 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/202009041751.084HpSmd391120%40masaka.moolenaar.net.

Raspunde prin e-mail lui