Mercurial > vim
comparison src/evalvars.c @ 30035:bbcdc76dcd71 v9.0.0355
patch 9.0.0355: check for uppercase char in autoload name is wrong
Commit: https://github.com/vim/vim/commit/6c667bdc9489963102bd6c46b1b73e4d43c034ce
Author: thinca <thinca@gmail.com>
Date: Fri Sep 2 11:25:37 2022 +0100
patch 9.0.0355: check for uppercase char in autoload name is wrong
Problem: Check for uppercase char in autoload name is wrong, it checks the
name of the script.
Solution: Remove the check. (closes #11031)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Sep 2022 12:30:06 +0200 |
parents | 6b7020f3d856 |
children | f5cbf8a4043d |
comparison
equal
deleted
inserted
replaced
30034:629977ec7f62 | 30035:bbcdc76dcd71 |
---|---|
4010 char_u *name, // points to start of variable name | 4010 char_u *name, // points to start of variable name |
4011 int new_var) // TRUE when creating the variable | 4011 int new_var) // TRUE when creating the variable |
4012 { | 4012 { |
4013 // Allow for w: b: s: and t:. In Vim9 script s: is not allowed, because | 4013 // Allow for w: b: s: and t:. In Vim9 script s: is not allowed, because |
4014 // the name can be used without the s: prefix. | 4014 // the name can be used without the s: prefix. |
4015 // Allow autoload variable. | |
4015 if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL | 4016 if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL |
4016 || (!in_vim9script() && name[0] == 's')) && name[1] == ':') | 4017 || (!in_vim9script() && name[0] == 's')) && name[1] == ':') |
4017 && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':') | 4018 && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':') |
4018 ? name[2] : name[0])) | 4019 ? name[2] : name[0]) |
4020 && vim_strchr(name, '#') == NULL) | |
4019 { | 4021 { |
4020 semsg(_(e_funcref_variable_name_must_start_with_capital_str), name); | 4022 semsg(_(e_funcref_variable_name_must_start_with_capital_str), name); |
4021 return TRUE; | 4023 return TRUE; |
4022 } | 4024 } |
4023 // Don't allow hiding a function. When "v" is not NULL we might be | 4025 // Don't allow hiding a function. When "v" is not NULL we might be |