diff src/eval.c @ 7664:1fded31d9e04 v7.4.1131

commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 18 23:29:01 2016 +0100 patch 7.4.1131 Problem: New lines in the viminfo file are dropped. Solution: Copy lines starting with "|". Fix that when using :rviminfo in a function global variables were restored as function-local variables.
author Christian Brabandt <cb@256bit.org>
date Mon, 18 Jan 2016 23:30:05 +0100
parents d4370fef0175
children eb9cc96138a3
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -25054,6 +25054,7 @@ read_viminfo_varlist(virp, writing)
     char_u	*tab;
     int		type = VAR_NUMBER;
     typval_T	tv;
+    funccall_T  *save_funccal;
 
     if (!writing && (find_viminfo_parameter('!') != NULL))
     {
@@ -25100,7 +25101,11 @@ read_viminfo_varlist(virp, writing)
 		    }
 		}
 
+		/* when in a function use global variables */
+		save_funccal = current_funccal;
+		current_funccal = NULL;
 		set_var(virp->vir_line + 1, &tv, FALSE);
+		current_funccal = save_funccal;
 
 		if (tv.v_type == VAR_STRING)
 		    vim_free(tv.vval.v_string);