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)
diff --git a/src/userfunc.c b/src/userfunc.c
index 1918e54..ded9ef7 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3094,7 +3094,15 @@
}
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)