mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.4508: Vim9: cannot assign to a global variable on the command line
Problem: Vim9: cannot assign to a global variable on the command line. Solution: Allow using :vim9cmd for assignment on the command line.
This commit is contained in:
@@ -754,12 +754,14 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get)
|
||||
void
|
||||
ex_var(exarg_T *eap)
|
||||
{
|
||||
char_u *p = eap->cmd;
|
||||
|
||||
if (!in_vim9script())
|
||||
{
|
||||
semsg(_(e_str_cannot_be_used_in_legacy_vim_script), ":var");
|
||||
return;
|
||||
}
|
||||
if (current_sctx.sc_sid == 0)
|
||||
if (current_sctx.sc_sid == 0 && checkforcmd_noparen(&p, "var", 3))
|
||||
{
|
||||
emsg(_(e_cannot_declare_variable_on_command_line));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user