diff --git a/src/filepath.c b/src/filepath.c index a1e281b0ee..d4592eba31 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -1493,6 +1493,12 @@ readdirex_checkitem(void *context, void *item) 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; diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 79fd80ae18..751cd6d602 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1386,6 +1386,10 @@ def Test_search() 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 diff --git a/src/version.c b/src/version.c index 80f464a36d..3c1eb1cf5c 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1485, /**/ 1484, /**/