mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
patch 8.2.3086: Vim9: breakpoint on "for" does not work
Problem: Vim9: breakpoint on "for" does not work. Solution: Use the right line number in ISN_DEBUG. (closes #8486)
This commit is contained in:
@@ -1017,6 +1017,13 @@ func Test_debug_def_function()
|
||||
# comment
|
||||
echo "second"
|
||||
enddef
|
||||
def g:FuncForLoop()
|
||||
eval 1
|
||||
for i in [11, 22, 33]
|
||||
eval i
|
||||
endfor
|
||||
echo "done"
|
||||
enddef
|
||||
END
|
||||
call writefile(file, 'Xtest.vim')
|
||||
|
||||
@@ -1062,6 +1069,15 @@ func Test_debug_def_function()
|
||||
call RunDbgCmd(buf, ':call FuncComment()', ['function FuncComment', 'line 2: echo "first" .. "one"'])
|
||||
call RunDbgCmd(buf, ':breakadd func 3 FuncComment')
|
||||
call RunDbgCmd(buf, 'cont', ['function FuncComment', 'line 5: echo "second"'])
|
||||
call RunDbgCmd(buf, 'cont')
|
||||
|
||||
call RunDbgCmd(buf, ':breakadd func 2 FuncForLoop')
|
||||
call RunDbgCmd(buf, ':call FuncForLoop()', ['function FuncForLoop', 'line 2: for i in [11, 22, 33]'])
|
||||
call RunDbgCmd(buf, 'echo i', ['11'])
|
||||
call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 3: eval i'])
|
||||
call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 4: endfor'])
|
||||
call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 2: for i in [11, 22, 33]'])
|
||||
call RunDbgCmd(buf, 'echo i', ['22'])
|
||||
|
||||
call RunDbgCmd(buf, 'cont')
|
||||
call StopVimInTerminal(buf)
|
||||
|
||||
Reference in New Issue
Block a user