diff src/userfunc.c @ 27279:6e1b0c4ab668 v8.2.4168

patch 8.2.4168: disallowing empty function name breaks existing plugins Commit: https://github.com/vim/vim/commit/e6a4200ff47708febcd7cb2b8c3dd3801a975d43 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 21 10:32:58 2022 +0000 patch 8.2.4168: disallowing empty function name breaks existing plugins Problem: Disallowing empty function name breaks existing plugins. Solution: Allow empty function name in legacy script.
author Bram Moolenaar <Bram@vim.org>
date Fri, 21 Jan 2022 11:45:03 +0100
parents b760dfee1bd7
children 53edd190a607
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3693,8 +3693,8 @@ trans_function_name(
     // Note that TFN_ flags use the same values as GLV_ flags.
     end = get_lval(start, NULL, &lv, FALSE, skip, flags | GLV_READ_ONLY,
 					      lead > 2 ? 0 : FNE_CHECK_START);
-    if (end == start
-		   || (end != NULL && end[-1] == AUTOLOAD_CHAR && *end == '('))
+    if (end == start || (in_vim9script() && end != NULL
+				   && end[-1] == AUTOLOAD_CHAR && *end == '('))
     {
 	if (!skip)
 	    emsg(_(e_function_name_required));