aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-13 06:46:46 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-11-13 06:47:43 +0800
commit32012b3fe872d146085c6bf200ae396f36cc5ae1 (patch)
treeb4068f7236e503fcdedc1f2c9fefbb2d26d2adc7
parent06acf78cd323c82cc40d701c92997503ecb4aeb5 (diff)
downloadrneovim-32012b3fe872d146085c6bf200ae396f36cc5ae1.tar.gz
rneovim-32012b3fe872d146085c6bf200ae396f36cc5ae1.tar.bz2
rneovim-32012b3fe872d146085c6bf200ae396f36cc5ae1.zip
vim-patch:8.2.3066: Vim9: debugging lambda does not work
Problem: Vim9: debugging lambda does not work. Solution: Use the compile type of the function when compiling a lambda. (closes vim/vim#8412) https://github.com/vim/vim/commit/17d868b8b268c9b9670421039d1a772341937add Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_debugger.vim30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/old/testdir/test_debugger.vim b/test/old/testdir/test_debugger.vim
index ba3893ae26..f1f546a027 100644
--- a/test/old/testdir/test_debugger.vim
+++ b/test/old/testdir/test_debugger.vim
@@ -971,7 +971,7 @@ func Test_Backtrace_DefFunction()
call delete('Xtest2.vim')
endfunc
-func Test_debug_DefFunction()
+func Test_debug_def_and_legacy_function()
CheckRunVimInTerminal
CheckCWD
let file =<< trim END
@@ -1109,6 +1109,34 @@ func Test_debug_def_function()
call delete('Xtest.vim')
endfunc
+func Test_debug_def_function_with_lambda()
+ CheckRunVimInTerminal
+ CheckCWD
+ let lines =<< trim END
+ vim9script
+ def g:Func()
+ var s = 'a'
+ ['b']->map((_, v) => s)
+ echo "done"
+ enddef
+ breakadd func 2 g:Func
+ END
+ call writefile(lines, 'XtestLambda.vim')
+
+ let buf = RunVimInTerminal('-S XtestLambda.vim', {})
+
+ call RunDbgCmd(buf,
+ \ ':call g:Func()',
+ \ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
+ call RunDbgCmd(buf,
+ \ 'next',
+ \ ['function Func', 'line 3: echo "done"'])
+
+ call RunDbgCmd(buf, 'cont')
+ call StopVimInTerminal(buf)
+ call delete('XtestLambda.vim')
+endfunc
+
func Test_debug_backtrace_level()
CheckRunVimInTerminal
CheckCWD