patch 8.2.0605: Vim9: cannot unlet an environment variable
Problem: Vim9: cannot unlet an environment variable.
Solution: Implement unlet for $VAR.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index e675869..6c8b8c8 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1073,6 +1073,9 @@
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 @@
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));