Mercurial > vim
diff src/structs.h @ 23249:43532077b5ff v8.2.2170
patch 8.2.2170: Vim9: a global function defined in a :def function fails
Commit: https://github.com/vim/vim/commit/f112f30a82f17114d8b08a0fb90928cd19440581
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 20 17:47:52 2020 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 20 Dec 2020 18:00:06 +0100 |
parents | fa87b0d1277b |
children | a84e7abb0c92 |
line wrap: on
line diff
--- a/src/structs.h +++ b/src/structs.h @@ -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