diff src/vim9compile.c @ 21335:af3663df42bf v8.2.1218

patch 8.2.1218: Vim9: cannot use 'text'->func() Commit: https://github.com/vim/vim/commit/3d48e25dcb661eb09ccdaa73d4e2559201ff2eb1 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 15 14:15:52 2020 +0200 patch 8.2.1218: Vim9: cannot use 'text'->func() Problem: Vim9: cannot use 'text'->func(). Solution: Recognize string at start of command.
author Bram Moolenaar <Bram@vim.org>
date Wed, 15 Jul 2020 14:30:04 +0200
parents 60011b87aae1
children 5dd4cbc1e9e6
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -7048,13 +7048,17 @@ compile_def_function(ufunc_T *ufunc, int
 
 	/*
 	 * COMMAND after range
+	 * 'text'->func() should not be confused with 'a mark
 	 */
 	cmd = ea.cmd;
-	ea.cmd = skip_range(ea.cmd, NULL);
-	if (ea.cmd > cmd && !starts_with_colon)
+	if (*cmd != '\'')
 	{
-	    emsg(_(e_colon_required));
-	    goto erret;
+	    ea.cmd = skip_range(ea.cmd, NULL);
+	    if (ea.cmd > cmd && !starts_with_colon)
+	    {
+		emsg(_(e_colon_required));
+		goto erret;
+	    }
 	}
 	p = find_ex_command(&ea, NULL, starts_with_colon ? NULL
 		   : (void *(*)(char_u *, size_t, cctx_T *))lookup_local,