summaryrefslogtreecommitdiffstats
path: root/src/evalvars.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-02 16:59:00 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-02 16:59:00 +0200
commitc2ee44cc382d4b097f51ea3251f00fb35493ea4f (patch)
tree2e4898d1e21091deeb29c749b5503f4e31cf7518 /src/evalvars.c
parentaa970abd0a987de96321d33db82f70bbceac931b (diff)
patch 8.2.1355: Vim9: no error using :let for options and registersv8.2.1355
Problem: Vim9: no error using :let for options and registers. Solution: Give an error. (closes #6568)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 73c4da6c6e..cf75487eaa 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1219,6 +1219,13 @@ ex_let_one(
int opt_flags;
char_u *tofree = NULL;
+ if (in_vim9script() && (flags & LET_NO_COMMAND) == 0
+ && vim_strchr((char_u *)"$@&", *arg) != NULL)
+ {
+ vim9_declare_error(arg);
+ return NULL;
+ }
+
// ":let $VAR = expr": Set environment variable.
if (*arg == '$')
{
@@ -1227,11 +1234,6 @@ ex_let_one(
emsg(_("E996: Cannot lock an environment variable"));
return NULL;
}
- if (in_vim9script() && (flags & LET_NO_COMMAND) == 0)
- {
- vim9_declare_error(arg);
- return NULL;
- }
// Find the end of the name.
++arg;
@@ -2427,7 +2429,7 @@ eval_variable(
else
{
scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);
- svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)
+ svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)
+ import->imp_var_vals_idx;
tv = sv->sv_tv;
}