mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
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 #8412)
This commit is contained in:
@@ -932,7 +932,7 @@ func Test_Backtrace_DefFunction()
|
||||
call delete('Xtest2.vim')
|
||||
endfunc
|
||||
|
||||
func Test_debug_DefFunction()
|
||||
func Test_debug_def_and_legacy_function()
|
||||
CheckCWD
|
||||
let file =<< trim END
|
||||
vim9script
|
||||
@@ -1068,6 +1068,33 @@ func Test_debug_def_function()
|
||||
call delete('Xtest.vim')
|
||||
endfunc
|
||||
|
||||
func Test_debug_def_function_with_lambda()
|
||||
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()
|
||||
CheckCWD
|
||||
let lines =<< trim END
|
||||
|
||||
Reference in New Issue
Block a user