1
0
forked from aniani/vim

patch 8.2.1023: Vim9: redefining a function uses a new index every time

Problem:    Vim9: redefining a function uses a new index every time.
Solution:   When redefining a function clear the contents and re-use the
            index.
This commit is contained in:
Bram Moolenaar
2020-06-20 18:19:09 +02:00
parent 845e0ee594
commit 0cb5bcf583
8 changed files with 57 additions and 37 deletions

View File

@@ -2628,7 +2628,7 @@ find_var_ht(char_u *name, char_u **varname)
if (*name == 'v') // v: variable
return &vimvarht;
if (get_current_funccal() != NULL
&& get_current_funccal()->func->uf_dfunc_idx == UF_NOT_COMPILED)
&& get_current_funccal()->func->uf_def_status == UF_NOT_COMPILED)
{
// a: and l: are only used in functions defined with ":function"
if (*name == 'a') // a: function argument