0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1218: Vim9: cannot use 'text'->func()

Problem:    Vim9: cannot use 'text'->func().
Solution:   Recognize string at start of command.
This commit is contained in:
Bram Moolenaar
2020-07-15 14:15:52 +02:00
parent 1e1f612bd4
commit 3d48e25dcb
4 changed files with 57 additions and 25 deletions

View File

@@ -7048,13 +7048,17 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
/*
* 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,