0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2170: Vim9: a global function defined in a :def function fails

Problem:    Vim9: a global function defined in a :def function fails if it
            uses the context.
Solution:   Create a partial to store the closure context. (see #7410)
This commit is contained in:
Bram Moolenaar
2020-12-20 17:47:52 +01:00
parent 090728ad4d
commit f112f30a82
6 changed files with 114 additions and 45 deletions

View File

@@ -1598,6 +1598,9 @@ typedef struct
garray_T uf_type_list; // types used in arg and return types
int *uf_def_arg_idx; // instruction indexes for evaluating
// uf_def_args; length: uf_def_args.ga_len + 1
partial_T *uf_partial; // for closure created inside :def function:
// information about the context
char_u *uf_va_name; // name from "...name" or NULL
type_T *uf_va_type; // type from "...name: type" or NULL
type_T *uf_func_type; // type of the function, &t_func_any if unknown