1
0
forked from aniani/vim

patch 8.2.0160: range test fails

Problem:    Range test fails.
Solution:   Include change in list code. (#5541)
This commit is contained in:
Bram Moolenaar
2020-01-27 22:37:23 +01:00
parent 50985eb1f0
commit 89bfc8218c
2 changed files with 13 additions and 0 deletions

View File

@@ -1992,6 +1992,7 @@ f_count(typval_T *argvars, typval_T *rettv)
if ((l = argvars[0].vval.v_list) != NULL) if ((l = argvars[0].vval.v_list) != NULL)
{ {
range_list_materialize(l);
li = l->lv_first; li = l->lv_first;
if (argvars[2].v_type != VAR_UNKNOWN) if (argvars[2].v_type != VAR_UNKNOWN)
{ {
@@ -2256,6 +2257,16 @@ f_reverse(typval_T *argvars, typval_T *rettv)
&& !var_check_lock(l->lv_lock, && !var_check_lock(l->lv_lock,
(char_u *)N_("reverse() argument"), TRUE)) (char_u *)N_("reverse() argument"), TRUE))
{ {
if (l->lv_first == &range_list_item)
{
varnumber_T new_start = l->lv_start
+ (l->lv_len - 1) * l->lv_stride;
l->lv_end = new_start - (l->lv_end - l->lv_start);
l->lv_start = new_start;
l->lv_stride = -l->lv_stride;
rettv_list_set(rettv, l);
return;
}
li = l->lv_last; li = l->lv_last;
l->lv_first = l->lv_last = NULL; l->lv_first = l->lv_last = NULL;
l->lv_len = 0; l->lv_len = 0;

View File

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