0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1355: Vim9: no error using :let for options and registers

Problem:    Vim9: no error using :let for options and registers.
Solution:   Give an error. (closes #6568)
This commit is contained in:
Bram Moolenaar
2020-08-02 16:59:00 +02:00
parent aa970abd0a
commit c2ee44cc38
4 changed files with 36 additions and 48 deletions

View File

@@ -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;
}