summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testdir/test_vim9_disassemble.vim13
-rw-r--r--src/version.c2
-rw-r--r--src/vim9execute.c9
3 files changed, 23 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim
index 6cde5dda7..f1f943ecb 100644
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -664,6 +664,19 @@ def Test_disassemble_lambda()
'\d PCALL (argc 1)\_s*' ..
'\d RETURN',
instr)
+
+ let name = substitute(instr, '.*\(<lambda>\d\+\).*', '\1', '')
+ instr = execute('disassemble ' .. name)
+ assert_match('<lambda>\d\+\_s*' ..
+ 'return "X" .. a .. "X"\_s*' ..
+ '\d PUSHS "X"\_s*' ..
+ '\d LOAD arg\[-1\]\_s*' ..
+ '\d 2STRING stack\[-1\]\_s*' ..
+ '\d CONCAT\_s*' ..
+ '\d PUSHS "X"\_s*' ..
+ '\d CONCAT\_s*' ..
+ '\d RETURN',
+ instr)
enddef
def AndOr(arg: any): string
diff --git a/src/version.c b/src/version.c
index 21ff2bc9e..87eda28b4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1200,
+/**/
1199,
/**/
1198,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 544c4226b..5fdbfbf51 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2397,7 +2397,14 @@ ex_disassemble(exarg_T *eap)
int prev_current = 0;
int is_global = FALSE;
- fname = trans_function_name(&arg, &is_global, FALSE,
+ if (STRNCMP(arg, "<lambda>", 8) == 0)
+ {
+ arg += 8;
+ (void)getdigits(&arg);
+ fname = vim_strnsave(eap->arg, arg - eap->arg);
+ }
+ else
+ fname = trans_function_name(&arg, &is_global, FALSE,
TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL);
if (fname == NULL)
{