Patch 8.2.1592

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 4, 2020, 1:51:41 PM9/4/20
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages