mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2771: Vim9: assignment not recognized if declaration was skipped
Problem: Vim9: assignment not recognized if declaration was skipped. Solution: Also recognized an assignment if the variable does not exist. (closes #8108)
This commit is contained in:
@@ -3483,7 +3483,8 @@ find_ex_command(
|
||||
|
||||
// Recognize an assignment if we recognize the variable name:
|
||||
// "g:var = expr"
|
||||
// "var = expr" where "var" is a variable name.
|
||||
// "var = expr" where "var" is a variable name or we are skipping
|
||||
// (variable declaration might have been skipped).
|
||||
if (*eap->cmd == '@')
|
||||
p = eap->cmd + 2;
|
||||
oplen = assignment_len(skipwhite(p), &heredoc);
|
||||
@@ -3493,6 +3494,7 @@ find_ex_command(
|
||||
|| *eap->cmd == '&'
|
||||
|| *eap->cmd == '$'
|
||||
|| *eap->cmd == '@'
|
||||
|| eap->skip
|
||||
|| lookup(eap->cmd, p - eap->cmd, TRUE, cctx) == OK)
|
||||
{
|
||||
eap->cmdidx = CMD_var;
|
||||
|
Reference in New Issue
Block a user