comparison src/vim9execute.c @ 22973:4c97c0747017 v8.2.2033

patch 8.2.2033: Vim9: :def without argument gives compilation error Commit: https://github.com/vim/vim/commit/6abdcf82859e158713a3d5aa6b1012748ea5c2a0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 22 18:15:44 2020 +0100 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 https://github.com/vim/vim/issues/7344)
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Nov 2020 18:30:05 +0100
parents 629472e2e4c5
children a943b175586a
comparison
equal deleted inserted replaced
22972:d2b36acb42dd 22973:4c97c0747017
1968 1968
1969 copy_func(newfunc->nf_lambda, newfunc->nf_global); 1969 copy_func(newfunc->nf_lambda, newfunc->nf_global);
1970 } 1970 }
1971 break; 1971 break;
1972 1972
1973 // List functions
1974 case ISN_DEF:
1975 if (iptr->isn_arg.string == NULL)
1976 list_functions(NULL);
1977 else
1978 {
1979 exarg_T ea;
1980
1981 CLEAR_FIELD(ea);
1982 ea.cmd = ea.arg = iptr->isn_arg.string;
1983 define_function(&ea, NULL);
1984 }
1985 break;
1986
1973 // jump if a condition is met 1987 // jump if a condition is met
1974 case ISN_JUMP: 1988 case ISN_JUMP:
1975 { 1989 {
1976 jumpwhen_T when = iptr->isn_arg.jump.jump_when; 1990 jumpwhen_T when = iptr->isn_arg.jump.jump_when;
1977 int error = FALSE; 1991 int error = FALSE;
3366 { 3380 {
3367 newfunc_T *newfunc = &iptr->isn_arg.newfunc; 3381 newfunc_T *newfunc = &iptr->isn_arg.newfunc;
3368 3382
3369 smsg("%4d NEWFUNC %s %s", current, 3383 smsg("%4d NEWFUNC %s %s", current,
3370 newfunc->nf_lambda, newfunc->nf_global); 3384 newfunc->nf_lambda, newfunc->nf_global);
3385 }
3386 break;
3387
3388 case ISN_DEF:
3389 {
3390 char_u *name = iptr->isn_arg.string;
3391
3392 smsg("%4d DEF %s", current,
3393 name == NULL ? (char_u *)"" : name);
3371 } 3394 }
3372 break; 3395 break;
3373 3396
3374 case ISN_JUMP: 3397 case ISN_JUMP:
3375 { 3398 {