From 148be9bc1cca16ce47ad21563f5835682001f9a2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 2 Feb 2021 21:33:52 +0100 Subject: 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) --- src/ex_docmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ex_docmd.c') diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 8b9db6812..d31b56c8c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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 -- cgit v1.2.1