aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-13 06:48:09 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-11-13 06:48:24 +0800
commit1cc2143710e9eb982c5184ee23eae542333a27e3 (patch)
tree1dce3ab514dc7a484a4aa78ea82ad74ce9de5c88
parent32012b3fe872d146085c6bf200ae396f36cc5ae1 (diff)
downloadrneovim-1cc2143710e9eb982c5184ee23eae542333a27e3.tar.gz
rneovim-1cc2143710e9eb982c5184ee23eae542333a27e3.tar.bz2
rneovim-1cc2143710e9eb982c5184ee23eae542333a27e3.zip
vim-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 vim/vim#8486) https://github.com/vim/vim/commit/6fc016168249360f0524b68f72cf33efd0574d40 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_debugger.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/old/testdir/test_debugger.vim b/test/old/testdir/test_debugger.vim
index f1f546a027..c6228815c9 100644
--- a/test/old/testdir/test_debugger.vim
+++ b/test/old/testdir/test_debugger.vim
@@ -1058,6 +1058,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')
@@ -1103,6 +1110,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)