diff src/vim9compile.c @ 25670:812c75fd255c v8.2.3371

patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line Commit: https://github.com/vim/vim/commit/5ca5cc6412d7d68fd380926f9551a8b7ba335199 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 24 21:56:03 2021 +0200 patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line Problem: Vim9: :$ENV cannot be followed by ->func() in next line. Solution: Use "$ENV" as the start of an expression. (closes https://github.com/vim/vim/issues/8790)
author Bram Moolenaar <Bram@vim.org>
date Tue, 24 Aug 2021 22:00:06 +0200
parents 7b80b25a5c2b
children 8556ded8a462
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -9745,9 +9745,11 @@ compile_def_function(
 	 * COMMAND after range
 	 * 'text'->func() should not be confused with 'a mark
 	 * "++nr" and "--nr" are eval commands
+	 * in "$ENV->func()" the "$" is not a range
 	 */
 	cmd = ea.cmd;
 	if (!(local_cmdmod.cmod_flags & CMOD_LEGACY)
+		&& (*cmd != '$' || starts_with_colon)
 		&& (starts_with_colon || !(*cmd == '\''
 		       || (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-')))))
 	{