To: vim_dev@googlegroups.com Subject: Patch 8.2.1572 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1572 Problem: Vim9: expand() does not take "true" as argument. Solution: Use tv_get_bool_chk(). (closes #6819) Files: src/evalfunc.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1571/src/evalfunc.c 2020-09-02 21:02:32.304208489 +0200 --- src/evalfunc.c 2020-09-02 21:36:01.998047313 +0200 *************** *** 2434,2440 **** rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN ! && tv_get_number_chk(&argvars[2], &error) && !error) rettv_list_set(rettv, NULL); --- 2434,2440 ---- rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN ! && tv_get_bool_chk(&argvars[2], &error) && !error) rettv_list_set(rettv, NULL); *************** *** 2458,2464 **** // When the optional second argument is non-zero, don't remove matches // for 'wildignore' and don't put matches for 'suffixes' at the end. if (argvars[1].v_type != VAR_UNKNOWN ! && tv_get_number_chk(&argvars[1], &error)) options |= WILD_KEEP_ALL; if (!error) { --- 2458,2464 ---- // When the optional second argument is non-zero, don't remove matches // for 'wildignore' and don't put matches for 'suffixes' at the end. if (argvars[1].v_type != VAR_UNKNOWN ! && tv_get_bool_chk(&argvars[1], &error)) options |= WILD_KEEP_ALL; if (!error) { *** ../vim-8.2.1571/src/testdir/test_vim9_func.vim 2020-09-02 21:30:04.667134268 +0200 --- src/testdir/test_vim9_func.vim 2020-09-02 21:35:27.850149775 +0200 *************** *** 1497,1502 **** --- 1497,1508 ---- assert_equal(0, count('ABC ABC ABC', 'b', false)) enddef + def Test_expand() + split SomeFile + assert_equal(['SomeFile'], expand('%', true, true)) + close + enddef + def Test_recursive_call() assert_equal(6765, Fibonacci(20)) enddef *** ../vim-8.2.1571/src/version.c 2020-09-02 21:30:04.667134268 +0200 --- src/version.c 2020-09-02 21:34:15.962366342 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1572, /**/ -- Computers are not intelligent. They only think they are. /// 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 ///