aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-04 16:28:59 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-04 16:29:26 +0800
commit32810c0818bd0a602c8f790c3fcb1d67194978c8 (patch)
treec5ef39be03cde2fdd60150a6cfa8759bf0433d83
parenta0dd663c2d321ce107aa07005aa01b9c341c5df2 (diff)
downloadrneovim-32810c0818bd0a602c8f790c3fcb1d67194978c8.tar.gz
rneovim-32810c0818bd0a602c8f790c3fcb1d67194978c8.tar.bz2
rneovim-32810c0818bd0a602c8f790c3fcb1d67194978c8.zip
vim-patch:8.2.4163: no error for omitting function name after autoload prefix
Problem: No error for omitting function name after autoload prefix. Solution: Check for missing function name. (issue vim/vim#9577) https://github.com/vim/vim/commit/2017d6f3b1d523204e5471e941cfa687b4da0058 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--src/nvim/eval/userfunc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index a37613dca9..028d08692d 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -1760,7 +1760,8 @@ char_u *trans_function_name(char **pp, bool skip, int flags, funcdict_T *fdp, pa
// Note that TFN_ flags use the same values as GLV_ flags.
end = (char_u *)get_lval((char *)start, NULL, &lv, false, skip, flags | GLV_READ_ONLY,
lead > 2 ? 0 : FNE_CHECK_START);
- if (end == start) {
+ if (end == start
+ || (end != NULL && end[-1] == AUTOLOAD_CHAR && *end == '(')) {
if (!skip) {
emsg(_("E129: Function name required"));
}