1
0
forked from aniani/vim

patch 8.1.1940: script tests fail

Problem:    Script tests fail.
Solution:   Don't set vimvars type in set_vim_var_nr().
This commit is contained in:
Bram Moolenaar 2019-08-29 22:48:24 +02:00
parent e5cdf153bc
commit 34ed68d40e
4 changed files with 15 additions and 1 deletions

View File

@ -7879,6 +7879,7 @@ filter_map(typval_T *argvars, typval_T *rettv, int map)
int i;
typval_T tv;
set_vim_var_type(VV_KEY, VAR_NUMBER);
for (i = 0; i < b->bv_ga.ga_len; i++)
{
tv.v_type = VAR_NUMBER;
@ -7907,6 +7908,8 @@ filter_map(typval_T *argvars, typval_T *rettv, int map)
else
{
// argvars[0].v_type == VAR_LIST
set_vim_var_type(VV_KEY, VAR_NUMBER);
for (li = l->lv_first; li != NULL; li = nli)
{
if (map && var_check_lock(li->li_tv.v_lock, arg_errmsg, TRUE))

View File

@ -1690,13 +1690,21 @@ get_user_var_name(expand_T *xp, int idx)
return NULL;
}
/*
* Set type of v: variable to "type".
*/
void
set_vim_var_type(int idx, vartype_T type)
{
vimvars[idx].vv_type = type;
}
/*
* Set number v: variable to "val".
*/
void
set_vim_var_nr(int idx, varnumber_T val)
{
vimvars[idx].vv_type = VAR_NUMBER;
vimvars[idx].vv_nr = val;
}

View File

@ -15,6 +15,7 @@ void ex_unlet(exarg_T *eap);
void ex_lockvar(exarg_T *eap);
int do_unlet(char_u *name, int forceit);
char_u *get_user_var_name(expand_T *xp, int idx);
void set_vim_var_type(int idx, vartype_T type);
void set_vim_var_nr(int idx, varnumber_T val);
typval_T *get_vim_var_tv(int idx);
varnumber_T get_vim_var_nr(int idx);

View File

@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1940,
/**/
1939,
/**/