0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0605: Vim9: cannot unlet an environment variable

Problem:    Vim9: cannot unlet an environment variable.
Solution:   Implement unlet for $VAR.
This commit is contained in:
Bram Moolenaar
2020-04-19 18:27:26 +02:00
parent eb58a24658
commit 7bdaea6e0d
6 changed files with 27 additions and 5 deletions

View File

@@ -1073,6 +1073,9 @@ call_def_function(
iptr->isn_arg.unlet.ul_forceit) == FAIL)
goto failed;
break;
case ISN_UNLETENV:
vim_unsetenv(iptr->isn_arg.unlet.ul_name);
break;
// create a list from items on the stack; uses a single allocation
// for the list header and the items
@@ -2119,6 +2122,11 @@ ex_disassemble(exarg_T *eap)
iptr->isn_arg.unlet.ul_forceit ? "!" : "",
iptr->isn_arg.unlet.ul_name);
break;
case ISN_UNLETENV:
smsg("%4d UNLETENV%s $%s", current,
iptr->isn_arg.unlet.ul_forceit ? "!" : "",
iptr->isn_arg.unlet.ul_name);
break;
case ISN_NEWLIST:
smsg("%4d NEWLIST size %lld", current,
(long long)(iptr->isn_arg.number));