comparison 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
comparison
equal deleted inserted replaced
20098:a901238a18a2 20099:058b41f85bcb
1071 case ISN_UNLET: 1071 case ISN_UNLET:
1072 if (do_unlet(iptr->isn_arg.unlet.ul_name, 1072 if (do_unlet(iptr->isn_arg.unlet.ul_name,
1073 iptr->isn_arg.unlet.ul_forceit) == FAIL) 1073 iptr->isn_arg.unlet.ul_forceit) == FAIL)
1074 goto failed; 1074 goto failed;
1075 break; 1075 break;
1076 case ISN_UNLETENV:
1077 vim_unsetenv(iptr->isn_arg.unlet.ul_name);
1078 break;
1076 1079
1077 // create a list from items on the stack; uses a single allocation 1080 // create a list from items on the stack; uses a single allocation
1078 // for the list header and the items 1081 // for the list header and the items
1079 case ISN_NEWLIST: 1082 case ISN_NEWLIST:
1080 if (exe_newlist(iptr->isn_arg.number, &ectx) == FAIL) 1083 if (exe_newlist(iptr->isn_arg.number, &ectx) == FAIL)
2114 case ISN_PUSHEXC: 2117 case ISN_PUSHEXC:
2115 smsg("%4d PUSH v:exception", current); 2118 smsg("%4d PUSH v:exception", current);
2116 break; 2119 break;
2117 case ISN_UNLET: 2120 case ISN_UNLET:
2118 smsg("%4d UNLET%s %s", current, 2121 smsg("%4d UNLET%s %s", current,
2122 iptr->isn_arg.unlet.ul_forceit ? "!" : "",
2123 iptr->isn_arg.unlet.ul_name);
2124 break;
2125 case ISN_UNLETENV:
2126 smsg("%4d UNLETENV%s $%s", current,
2119 iptr->isn_arg.unlet.ul_forceit ? "!" : "", 2127 iptr->isn_arg.unlet.ul_forceit ? "!" : "",
2120 iptr->isn_arg.unlet.ul_name); 2128 iptr->isn_arg.unlet.ul_name);
2121 break; 2129 break;
2122 case ISN_NEWLIST: 2130 case ISN_NEWLIST:
2123 smsg("%4d NEWLIST size %lld", current, 2131 smsg("%4d NEWLIST size %lld", current,