mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.2.0972: Vim9 script variable declarations need a type
Problem: Vim9 script variable declarations need a type. Solution: Make "let var: type" declare a script-local variable.
This commit is contained in:
@@ -728,8 +728,18 @@ ex_let(exarg_T *eap)
|
||||
else if (expr[0] == '.')
|
||||
emsg(_("E985: .= is not supported with script version 2"));
|
||||
else if (!ends_excmd2(eap->cmd, arg))
|
||||
// ":let var1 var2"
|
||||
arg = list_arg_vars(eap, arg, &first);
|
||||
{
|
||||
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
// Vim9 declaration ":let var: type"
|
||||
arg = vim9_declare_scriptvar(eap, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ":let var1 var2" - list values
|
||||
arg = list_arg_vars(eap, arg, &first);
|
||||
}
|
||||
}
|
||||
else if (!eap->skip)
|
||||
{
|
||||
// ":let"
|
||||
|
Reference in New Issue
Block a user