Mercurial > vim
diff src/userfunc.c @ 27472:55613f0d59bc v8.2.4264
patch 8.2.4264: Vim9: can use old style autoload function name
Commit: https://github.com/vim/vim/commit/d8fe6d34bb582438142d7c1f73d0bd8537bb3a7a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 30 18:40:44 2022 +0000
patch 8.2.4264: Vim9: can use old style autoload function name
Problem: Vim9: can use old style autoload function name.
Solution: Give an error for old style autoload function name.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 30 Jan 2022 19:45:03 +0100 |
parents | a14c4d3e3260 |
children | 4f1cf9579e4e |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -4232,6 +4232,11 @@ define_function(exarg_T *eap, char_u *na name = prefixed; } } + else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL) + { + emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead)); + goto ret_free; + } } // An error in a function call during evaluation of an expression in magic @@ -4540,12 +4545,6 @@ define_function(exarg_T *eap, char_u *na } } } - else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL) - { - semsg(_(e_using_autoload_name_in_non_autoload_script_str), - name); - goto erret; - } } if (var_conflict) {