Merge pull request #41235 from janlazo/vim-8.2.1572

vim-patch:8.2.{1572,1573,1574,1575,1576,1577}
This commit is contained in:
zeertzjq
2026-08-08 12:50:25 +08:00
committed by GitHub
3 changed files with 14 additions and 14 deletions

View File

@@ -932,15 +932,15 @@ void f_glob(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
// for 'wildignore' and don't put matches for 'suffixes' at the end.
rettv->v_type = VAR_STRING;
if (argvars[1].v_type != VAR_UNKNOWN) {
if (tv_get_number_chk(&argvars[1], &error)) {
if (tv_get_bool_chk(&argvars[1], &error)) {
options |= WILD_KEEP_ALL;
}
if (argvars[2].v_type != VAR_UNKNOWN) {
if (tv_get_number_chk(&argvars[2], &error)) {
if (tv_get_bool_chk(&argvars[2], &error)) {
tv_list_set_ret(rettv, NULL);
}
if (argvars[3].v_type != VAR_UNKNOWN
&& tv_get_number_chk(&argvars[3], &error)) {
&& tv_get_bool_chk(&argvars[3], &error)) {
options |= WILD_ALLLINKS;
}
}
@@ -981,16 +981,16 @@ void f_globpath(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
if (argvars[2].v_type != VAR_UNKNOWN) {
// 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 (tv_get_number_chk(&argvars[2], &error)) {
if (tv_get_bool_chk(&argvars[2], &error)) {
flags |= WILD_KEEP_ALL;
}
if (argvars[3].v_type != VAR_UNKNOWN) {
if (tv_get_number_chk(&argvars[3], &error)) {
if (tv_get_bool_chk(&argvars[3], &error)) {
tv_list_set_ret(rettv, NULL);
}
if (argvars[4].v_type != VAR_UNKNOWN
&& tv_get_number_chk(&argvars[4], &error)) {
&& tv_get_bool_chk(&argvars[4], &error)) {
flags |= WILD_ALLLINKS;
}
}

View File

@@ -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) {
@@ -2380,9 +2380,9 @@ static void f_getreg(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
if (argvars[0].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_UNKNOWN) {
bool error = false;
arg2 = (int)tv_get_number_chk(&argvars[1], &error);
arg2 = (int)tv_get_bool_chk(&argvars[1], &error);
if (!error && argvars[2].v_type != VAR_UNKNOWN) {
return_list = (bool)tv_get_number_chk(&argvars[2], &error);
return_list = (bool)tv_get_bool_chk(&argvars[2], &error);
}
if (error) {
return;
@@ -2838,7 +2838,7 @@ static void f_index(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
assert(item != NULL);
}
if (argvars[3].v_type != VAR_UNKNOWN) {
ic = !!tv_get_number_chk(&argvars[3], &error);
ic = !!tv_get_bool_chk(&argvars[3], &error);
if (error) {
item = NULL;
}

View File

@@ -2072,7 +2072,7 @@ void f_hasmapto(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
} else {
mode = tv_get_string_buf(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN) {
abbr = tv_get_number(&argvars[2]);
abbr = tv_get_bool(&argvars[2]);
}
}
@@ -2164,9 +2164,9 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
if (argvars[1].v_type != VAR_UNKNOWN) {
which = tv_get_string_buf_chk(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN) {
abbr = (bool)tv_get_number(&argvars[2]);
abbr = (bool)tv_get_bool(&argvars[2]);
if (argvars[3].v_type != VAR_UNKNOWN) {
get_dict = (bool)tv_get_number(&argvars[3]);
get_dict = (bool)tv_get_bool(&argvars[3]);
}
}
} else {