]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0160: range test fails v8.2.0160
authorBram Moolenaar <Bram@vim.org>
Mon, 27 Jan 2020 21:37:23 +0000 (22:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 27 Jan 2020 21:37:23 +0000 (22:37 +0100)
Problem:    Range test fails.
Solution:   Include change in list code. (#5541)

src/list.c
src/version.c

index 4071a7d7fe3a15161da45c7d4caf42df36b367a8..d5d09f66c4251fc34d4d8b64fa2eb65fc4a49a5a 100644 (file)
@@ -1992,6 +1992,7 @@ f_count(typval_T *argvars, typval_T *rettv)
 
        if ((l = argvars[0].vval.v_list) != NULL)
        {
+           range_list_materialize(l);
            li = l->lv_first;
            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,
                                    (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;
        l->lv_first = l->lv_last = NULL;
        l->lv_len = 0;
index 7c7e5544296c019ac711226f547f13ab98e80480..562b5fbed336997dd443f7a644f3f6464e9db8cb 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    160,
 /**/
     159,
 /**/