diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index c411362018..0934864040 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1293,7 +1293,7 @@ static void f_expand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) 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) + && tv_get_bool_chk(&argvars[2], &error) && !error) { tv_list_set_ret(rettv, NULL); } @@ -1324,7 +1324,7 @@ static void f_expand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) // 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)) { + && tv_get_bool_chk(&argvars[1], &error)) { options |= WILD_KEEP_ALL; } if (!error) {