patch 8.2.1218: Vim9: cannot use 'text'->func()
Problem: Vim9: cannot use 'text'->func().
Solution: Recognize string at start of command.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 30a92ff..39190c9 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -7048,13 +7048,17 @@
/*
* 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,