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

patch 8.2.2316: Vim9: cannot list a lambda function

Problem:    Vim9: cannot list a lambda function.
Solution:   Support the <lambda>9 notation, like :disassemble. (closes #7634)
This commit is contained in:
Bram Moolenaar
2021-01-08 22:24:19 +01:00
parent 832ea89ca9
commit b657198cb3
3 changed files with 21 additions and 1 deletions

View File

@@ -3094,7 +3094,15 @@ define_function(exarg_T *eap, char_u *name_arg)
}
else
{
name = trans_function_name(&p, &is_global, eap->skip,
if (STRNCMP(p, "<lambda>", 8) == 0)
{
p += 8;
(void)getdigits(&p);
name = vim_strnsave(eap->arg, p - eap->arg);
CLEAR_FIELD(fudi);
}
else
name = trans_function_name(&p, &is_global, eap->skip,
TFN_NO_AUTOLOAD, &fudi, NULL, NULL);
paren = (vim_strchr(p, '(') != NULL);
if (name == NULL && (fudi.fd_dict == NULL || !paren) && !eap->skip)