comparison 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
comparison
equal deleted inserted replaced
7663:c4b2ec5485e5 7664:1fded31d9e04
25052 int writing; 25052 int writing;
25053 { 25053 {
25054 char_u *tab; 25054 char_u *tab;
25055 int type = VAR_NUMBER; 25055 int type = VAR_NUMBER;
25056 typval_T tv; 25056 typval_T tv;
25057 funccall_T *save_funccal;
25057 25058
25058 if (!writing && (find_viminfo_parameter('!') != NULL)) 25059 if (!writing && (find_viminfo_parameter('!') != NULL))
25059 { 25060 {
25060 tab = vim_strchr(virp->vir_line + 1, '\t'); 25061 tab = vim_strchr(virp->vir_line + 1, '\t');
25061 if (tab != NULL) 25062 if (tab != NULL)
25098 tv = *etv; 25099 tv = *etv;
25099 vim_free(etv); 25100 vim_free(etv);
25100 } 25101 }
25101 } 25102 }
25102 25103
25104 /* when in a function use global variables */
25105 save_funccal = current_funccal;
25106 current_funccal = NULL;
25103 set_var(virp->vir_line + 1, &tv, FALSE); 25107 set_var(virp->vir_line + 1, &tv, FALSE);
25108 current_funccal = save_funccal;
25104 25109
25105 if (tv.v_type == VAR_STRING) 25110 if (tv.v_type == VAR_STRING)
25106 vim_free(tv.vval.v_string); 25111 vim_free(tv.vval.v_string);
25107 else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST) 25112 else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST)
25108 clear_tv(&tv); 25113 clear_tv(&tv);