0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.2405: Vim9: no need to allow white space before "(" for :def

Problem:    Vim9: no need to allow white space before "(" for :def.
Solution:   Give an error for stray white space. (issue #7734)
This commit is contained in:
Bram Moolenaar
2021-01-24 21:14:20 +01:00
parent 107e9cecf7
commit 4efd994829
3 changed files with 40 additions and 0 deletions

View File

@@ -3199,6 +3199,12 @@ define_function(exarg_T *eap, char_u *name_arg)
p = vim_strchr(p, '(');
}
if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1]))
{
semsg(_(e_no_white_space_allowed_before_str), "(");
goto ret_free;
}
// In Vim9 script only global functions can be redefined.
if (vim9script && eap->forceit && !is_global)
{