patch 8.2.2033: Vim9: :def without argument gives compilation error
Problem: Vim9: :def without argument gives compilation error.
Solution: Add the DEF instruction. (closes #7344)
diff --git a/src/vim9execute.c b/src/vim9execute.c
index f154249..8b614bf 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1970,6 +1970,20 @@
}
break;
+ // List functions
+ case ISN_DEF:
+ if (iptr->isn_arg.string == NULL)
+ list_functions(NULL);
+ else
+ {
+ exarg_T ea;
+
+ CLEAR_FIELD(ea);
+ ea.cmd = ea.arg = iptr->isn_arg.string;
+ define_function(&ea, NULL);
+ }
+ break;
+
// jump if a condition is met
case ISN_JUMP:
{
@@ -3371,6 +3385,15 @@
}
break;
+ case ISN_DEF:
+ {
+ char_u *name = iptr->isn_arg.string;
+
+ smsg("%4d DEF %s", current,
+ name == NULL ? (char_u *)"" : name);
+ }
+ break;
+
case ISN_JUMP:
{
char *when = "?";