diff options
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index a5768599a..32c803fd9 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -1206,14 +1206,7 @@ ex_let_one( } if (p != NULL) { - vim_setenv(name, p); - if (STRICMP(name, "HOME") == 0) - init_homedir(); - else if (didset_vim && STRICMP(name, "VIM") == 0) - didset_vim = FALSE; - else if (didset_vimruntime - && STRICMP(name, "VIMRUNTIME") == 0) - didset_vimruntime = FALSE; + vim_setenv_ext(name, p); arg_end = arg; } name[len] = c1; @@ -1967,6 +1960,24 @@ get_vim_var_tv(int idx) } /* + * Set v: variable to "tv". Only accepts the same type. + * Takes over the value of "tv". + */ + int +set_vim_var_tv(int idx, typval_T *tv) +{ + if (vimvars[idx].vv_type != tv->v_type) + { + emsg(_("E1063: type mismatch for v: variable")); + clear_tv(tv); + return FAIL; + } + clear_tv(&vimvars[idx].vv_di.di_tv); + vimvars[idx].vv_di.di_tv = *tv; + return OK; +} + +/* * Get number v: variable value. */ varnumber_T |