Patch 8.2.1485
Problem: Vim9: readdirex() expression doesn't accept bool.
Solution: Accept both -1 and bool. (closes #6737)
Files: src/filepath.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.1484/src/filepath.c 2020-06-29 21:14:47.250822196 +0200
--- src/filepath.c 2020-08-19 13:53:59.892850683 +0200
***************
*** 1493,1498 ****
--- 1493,1504 ----
if (eval_expr_typval(expr, argv, 1, &rettv) == FAIL)
goto theend;
+ // We want to use -1, but also true/false should be allowed.
+ if (rettv.v_type == VAR_SPECIAL || rettv.v_type == VAR_BOOL)
+ {
+ rettv.v_type = VAR_NUMBER;
+ rettv.vval.v_number = rettv.vval.v_number == VVAL_TRUE;
+ }
retval = tv_get_number_chk(&rettv, &error);
if (error)
retval = -1;
*** ../vim-8.2.1484/src/testdir/test_vim9_func.vim 2020-08-18 19:11:34.486104966 +0200
--- src/testdir/test_vim9_func.vim 2020-08-19 13:53:29.153024969 +0200
***************
*** 1386,1391 ****
--- 1386,1395 ----
assert_equal(2, search('bar', 'W', 0, 0, {-> val == 1}))
enddef
+ def Test_readdirex()
+ eval expand('.')->readdirex({e ->
e.name[0] !=# '.'})
+ enddef
+
def Fibonacci(n: number): number
if n < 2
return n
*** ../vim-8.2.1484/src/version.c 2020-08-18 23:24:09.916049066 +0200
--- src/version.c 2020-08-19 13:52:38.169313886 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1485,
/**/
--
hundred-and-one symptoms of being an internet addict:
240. You think Webster's Dictionary is a directory of WEB sites.
/// 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 ///