summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-19 18:27:26 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-19 18:27:26 +0200
commit7bdaea6e0df849cf3dd7eaaf454eb88f637d1884 (patch)
treefb91b5cbe233e4fe9ab0b52a7851a6f47c5cd84c /src/vim9execute.c
parenteb58a2465825c258beafae96240824923f73779f (diff)
downloadvim-git-7bdaea6e0df849cf3dd7eaaf454eb88f637d1884.tar.gz
patch 8.2.0605: Vim9: cannot unlet an environment variablev8.2.0605
Problem: Vim9: cannot unlet an environment variable. Solution: Implement unlet for $VAR.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index e6758698c..6c8b8c86e 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -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));