0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4886: Vim9: redir in skipped block seen as assignment

Problem:    Vim9: redir in skipped block seen as assignment.
Solution:   Check for valid assignment.
This commit is contained in:
Bram Moolenaar
2022-05-06 14:29:09 +01:00
parent f1d63b9cba
commit bc6f2bf78a
3 changed files with 13 additions and 1 deletions

View File

@@ -3683,6 +3683,7 @@ find_ex_command(
// "&opt = expr"
// "var = expr" where "var" is a variable name or we are skipping
// (variable declaration might have been skipped).
// Not "redir => var" (when skipping).
oplen = assignment_len(skipwhite(p), &heredoc);
if (oplen > 0)
{
@@ -3690,7 +3691,8 @@ find_ex_command(
|| *eap->cmd == '&'
|| *eap->cmd == '$'
|| *eap->cmd == '@'
|| eap->skip
|| (eap->skip && IS_WHITE_OR_NUL(
*(skipwhite(p) + oplen)))
|| lookup(eap->cmd, p - eap->cmd, TRUE, cctx) == OK)
{
eap->cmdidx = CMD_var;