comparison src/list.c @ 19203:09f01421a356 v8.2.0160

patch 8.2.0160: range test fails Commit: https://github.com/vim/vim/commit/89bfc8218c1b3f41cc5d0fe06afd7d0fb2bd5dc6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 27 22:37:23 2020 +0100 patch 8.2.0160: range test fails Problem: Range test fails. Solution: Include change in list code. (https://github.com/vim/vim/issues/5541)
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Jan 2020 22:45:04 +0100
parents 94eda51ba9ba
children d776967d0f0d
comparison
equal deleted inserted replaced
19202:d4b246f286ec 19203:09f01421a356
1990 list_T *l; 1990 list_T *l;
1991 long idx; 1991 long idx;
1992 1992
1993 if ((l = argvars[0].vval.v_list) != NULL) 1993 if ((l = argvars[0].vval.v_list) != NULL)
1994 { 1994 {
1995 range_list_materialize(l);
1995 li = l->lv_first; 1996 li = l->lv_first;
1996 if (argvars[2].v_type != VAR_UNKNOWN) 1997 if (argvars[2].v_type != VAR_UNKNOWN)
1997 { 1998 {
1998 if (argvars[3].v_type != VAR_UNKNOWN) 1999 if (argvars[3].v_type != VAR_UNKNOWN)
1999 { 2000 {
2254 semsg(_(e_listblobarg), "reverse()"); 2255 semsg(_(e_listblobarg), "reverse()");
2255 else if ((l = argvars[0].vval.v_list) != NULL 2256 else if ((l = argvars[0].vval.v_list) != NULL
2256 && !var_check_lock(l->lv_lock, 2257 && !var_check_lock(l->lv_lock,
2257 (char_u *)N_("reverse() argument"), TRUE)) 2258 (char_u *)N_("reverse() argument"), TRUE))
2258 { 2259 {
2260 if (l->lv_first == &range_list_item)
2261 {
2262 varnumber_T new_start = l->lv_start
2263 + (l->lv_len - 1) * l->lv_stride;
2264 l->lv_end = new_start - (l->lv_end - l->lv_start);
2265 l->lv_start = new_start;
2266 l->lv_stride = -l->lv_stride;
2267 rettv_list_set(rettv, l);
2268 return;
2269 }
2259 li = l->lv_last; 2270 li = l->lv_last;
2260 l->lv_first = l->lv_last = NULL; 2271 l->lv_first = l->lv_last = NULL;
2261 l->lv_len = 0; 2272 l->lv_len = 0;
2262 while (li != NULL) 2273 while (li != NULL)
2263 { 2274 {