diff src/userfunc.c @ 22339:56f674e7518c v8.2.1718

patch 8.2.1718: Vim9: :def function disallows "firstline" for no good reason Commit: https://github.com/vim/vim/commit/b816dae16dbeec91ccb6fd1c0289b86b4ad5d7b3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 20 22:04:00 2020 +0200 patch 8.2.1718: Vim9: :def function disallows "firstline" for no good reason Problem: Vim9: :def function disallows "firstline" and "lastline" argument names for no good reason. Solution: Don't check the arguments for a :def function. (closes #6986)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Sep 2020 22:15:03 +0200
parents fb69b43d73f3
children b66a2e046c2e
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -66,8 +66,9 @@ one_function_arg(char_u *arg, garray_T *
     while (ASCII_ISALNUM(*p) || *p == '_')
 	++p;
     if (arg == p || isdigit(*arg)
-	    || (p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0)
-	    || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0))
+	    || (argtypes == NULL
+		&& ((p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0)
+		    || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0))))
     {
 	if (!skip)
 	    semsg(_("E125: Illegal argument: %s"), arg);