diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 06:39:39 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 06:46:17 +0800 |
commit | d46b6b2978808adf328b3326d6253ebcc01996e3 (patch) | |
tree | fa809321c0a137c46f386744b984628d253a8979 | |
parent | 3e8541f4a0d8177bf8451f7aa6387e6f04b0d963 (diff) | |
download | rneovim-d46b6b2978808adf328b3326d6253ebcc01996e3.tar.gz rneovim-d46b6b2978808adf328b3326d6253ebcc01996e3.tar.bz2 rneovim-d46b6b2978808adf328b3326d6253ebcc01996e3.zip |
vim-patch:8.2.3011: Vim9: cannot get argument values during debugging
Problem: Vim9: cannot get argument values during debugging.
Solution: Lookup names in the list of arguments. Put debug instruction
halfway for command.
https://github.com/vim/vim/commit/6bc30b05e6081bcaece6d1a7fcfca238ea5a194f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | test/old/testdir/test_debugger.vim | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/test/old/testdir/test_debugger.vim b/test/old/testdir/test_debugger.vim index 8e7c814ac7..0f6b55cf07 100644 --- a/test/old/testdir/test_debugger.vim +++ b/test/old/testdir/test_debugger.vim @@ -977,12 +977,20 @@ func Test_debug_def_function() let file =<< trim END vim9script def g:Func() - var n: number - def Closure(): number - return n + 3 - enddef - n += Closure() - echo 'result: ' .. n + var n: number + def Closure(): number + return n + 3 + enddef + n += Closure() + echo 'result: ' .. n + enddef + + def g:FuncWithArgs(text: string, nr: number, ...items: list<number>) + echo text .. nr + for it in items + echo it + endfor + echo "done" enddef END call writefile(file, 'Xtest.vim') @@ -994,7 +1002,30 @@ func Test_debug_def_function() \ ['cmd: call Func()']) call RunDbgCmd(buf, 'next', ['result: 3']) call term_sendkeys(buf, "\r") + call RunDbgCmd(buf, 'cont') + call RunDbgCmd(buf, + \ ':debug call FuncWithArgs("asdf", 42, 1, 2, 3)', + \ ['cmd: call FuncWithArgs("asdf", 42, 1, 2, 3)']) + call RunDbgCmd(buf, 'step', ['line 1: echo text .. nr']) + call RunDbgCmd(buf, 'echo text', ['asdf']) + call RunDbgCmd(buf, 'echo nr', ['42']) + call RunDbgCmd(buf, 'echo items', ['[1, 2, 3]']) + call RunDbgCmd(buf, 'step', ['asdf42', 'function FuncWithArgs', 'line 2: for it in items']) + call RunDbgCmd(buf, 'echo it', ['1']) + call RunDbgCmd(buf, 'step', ['line 3: echo it']) + call RunDbgCmd(buf, 'step', ['1', 'function FuncWithArgs', 'line 4: endfor']) + call RunDbgCmd(buf, 'step', ['line 2: for it in items']) + call RunDbgCmd(buf, 'echo it', ['2']) + call RunDbgCmd(buf, 'step', ['line 3: echo it']) + call RunDbgCmd(buf, 'step', ['2', 'function FuncWithArgs', 'line 4: endfor']) + call RunDbgCmd(buf, 'step', ['line 2: for it in items']) + call RunDbgCmd(buf, 'echo it', ['3']) + call RunDbgCmd(buf, 'step', ['line 3: echo it']) + call RunDbgCmd(buf, 'step', ['3', 'function FuncWithArgs', 'line 4: endfor']) + call RunDbgCmd(buf, 'step', ['line 5: echo "done"']) + + call RunDbgCmd(buf, 'cont') call StopVimInTerminal(buf) call delete('Xtest.vim') endfunc |