0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work

Problem:    Vim9: a variable name with "->" in the next line doesn't work.
Solution:   Recognize a variable name by itself. (closes #7770)
This commit is contained in:
Bram Moolenaar
2021-02-02 21:33:52 +01:00
parent d5e8c92816
commit 148be9bc1c
3 changed files with 35 additions and 0 deletions

View File

@@ -3424,6 +3424,16 @@ find_ex_command(
return eap->cmd;
}
}
// If it is an ID it might be a variable with an operator on the next
// line, if the variable exists it can't be an Ex command.
if (p > eap->cmd && ends_excmd(*skipwhite(p))
&& (lookup(eap->cmd, p - eap->cmd, NULL, cctx) == OK
|| (ASCII_ISALPHA(eap->cmd[0]) && eap->cmd[1] == ':')))
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
}
#endif