To: vim_dev@googlegroups.com Subject: Patch 8.2.1611 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1611 Problem: Vim9: cannot pass "true" to nr2char(). Solution: use tv_get_bool_chk(). (closes #6878) Files: src/evalfunc.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1610/src/evalfunc.c 2020-09-05 20:16:54.330410797 +0200 --- src/evalfunc.c 2020-09-05 20:21:46.573757178 +0200 *************** *** 5874,5880 **** int utf8 = 0; if (argvars[1].v_type != VAR_UNKNOWN) ! utf8 = (int)tv_get_number_chk(&argvars[1], NULL); if (utf8) buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL; else --- 5874,5880 ---- int utf8 = 0; if (argvars[1].v_type != VAR_UNKNOWN) ! utf8 = (int)tv_get_bool_chk(&argvars[1], NULL); if (utf8) buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL; else *** ../vim-8.2.1610/src/testdir/test_vim9_func.vim 2020-09-05 20:16:54.330410797 +0200 --- src/testdir/test_vim9_func.vim 2020-09-05 20:20:13.913966457 +0200 *************** *** 1529,1534 **** --- 1529,1538 ---- assert_equal(s, list2str(l, true)) enddef + def Test_nr2char() + assert_equal('a', nr2char(97, true)) + enddef + def Fibonacci(n: number): number if n < 2 return n *** ../vim-8.2.1610/src/version.c 2020-09-05 20:16:54.330410797 +0200 --- src/version.c 2020-09-05 20:21:20.049817250 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1611, /**/ -- FATHER: You killed eight wedding guests in all! LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady. FATHER: I can understand that. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@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 ///