changeset 17887:39ffd167a307 v8.1.1940

patch 8.1.1940: script tests fail Commit: https://github.com/vim/vim/commit/34ed68d40eb9c71f34a44b94263f5e7e6856cba0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 29 22:48:24 2019 +0200 patch 8.1.1940: script tests fail Problem: Script tests fail. Solution: Don't set vimvars type in set_vim_var_nr().
author Bram Moolenaar <Bram@vim.org>
date Thu, 29 Aug 2019 23:00:03 +0200
parents 302f29000890
children d4d44677c041
files src/eval.c src/evalvars.c src/proto/evalvars.pro src/version.c
diffstat 4 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -7879,6 +7879,7 @@ filter_map(typval_T *argvars, typval_T *
 	    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 *
 	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))
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1691,12 +1691,20 @@ get_user_var_name(expand_T *xp, int idx)
 }
 
 /*
+ * 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;
 }
 
--- a/src/proto/evalvars.pro
+++ b/src/proto/evalvars.pro
@@ -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);
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1940,
+/**/
     1939,
 /**/
     1938,