Mercurial > vim
diff src/vim9execute.c @ 20099:058b41f85bcb v8.2.0605
patch 8.2.0605: Vim9: cannot unlet an environment variable
Commit: https://github.com/vim/vim/commit/7bdaea6e0df849cf3dd7eaaf454eb88f637d1884
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 19 18:27:26 2020 +0200
patch 8.2.0605: Vim9: cannot unlet an environment variable
Problem: Vim9: cannot unlet an environment variable.
Solution: Implement unlet for $VAR.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 Apr 2020 18:30:04 +0200 |
parents | a64c16ff98b8 |
children | 39a18a0df429 |
line wrap: on
line diff
--- 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));