Mercurial > vim
diff src/testdir/test_debugger.vim @ 25098:765a642e0e20 v8.2.3086
patch 8.2.3086: Vim9: breakpoint on "for" does not work
Commit: https://github.com/vim/vim/commit/6fc016168249360f0524b68f72cf33efd0574d40
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 3 13:36:31 2021 +0200
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 https://github.com/vim/vim/issues/8486)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Jul 2021 13:45:04 +0200 |
parents | 671ded1facd5 |
children | 12fd67997953 |
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim +++ b/src/testdir/test_debugger.vim @@ -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)