summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthinca <thinca@gmail.com>2022-09-02 11:25:37 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-02 11:25:37 +0100
commit6c667bdc9489963102bd6c46b1b73e4d43c034ce (patch)
tree5c652a4a471e06324618c43ffc3b2d0dccfee257
parenta906e8e1abf0a4c9a058ec5ee8a4c321a008cd41 (diff)
downloadvim-git-6c667bdc9489963102bd6c46b1b73e4d43c034ce.tar.gz
patch 9.0.0355: check for uppercase char in autoload name is wrongv9.0.0355
Problem: Check for uppercase char in autoload name is wrong, it checks the name of the script. Solution: Remove the check. (closes #11031)
-rw-r--r--src/evalvars.c4
-rw-r--r--src/testdir/test_let.vim4
-rw-r--r--src/version.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 71cab0a30..f5761f958 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -4012,10 +4012,12 @@ var_wrong_func_name(
{
// Allow for w: b: s: and t:. In Vim9 script s: is not allowed, because
// the name can be used without the s: prefix.
+ // Allow autoload variable.
if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL
|| (!in_vim9script() && name[0] == 's')) && name[1] == ':')
&& !ASCII_ISUPPER((name[0] != NUL && name[1] == ':')
- ? name[2] : name[0]))
+ ? name[2] : name[0])
+ && vim_strchr(name, '#') == NULL)
{
semsg(_(e_funcref_variable_name_must_start_with_capital_str), name);
return TRUE;
diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim
index fb315e89e..9822e6f1b 100644
--- a/src/testdir/test_let.vim
+++ b/src/testdir/test_let.vim
@@ -8,6 +8,10 @@ func Test_let()
let Test104#numvar = function('tr')
call assert_equal("function('tr')", string(Test104#numvar))
+ let foo#tr = function('tr')
+ call assert_equal("function('tr')", string(foo#tr))
+ unlet foo#tr
+
let a = 1
let b = 2
diff --git a/src/version.c b/src/version.c
index 2009980dc..356ac7796 100644
--- a/src/version.c
+++ b/src/version.c
@@ -708,6 +708,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 355,
+/**/
354,
/**/
353,