0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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)
This commit is contained in:
Bram Moolenaar
2020-11-22 18:15:44 +01:00
parent dcbab75db3
commit 6abdcf8285
9 changed files with 127 additions and 9 deletions

View File

@@ -1970,6 +1970,20 @@ call_def_function(
}
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 @@ ex_disassemble(exarg_T *eap)
}
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 = "?";