0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.3039: Vim9: breakpoint at a comment line does not work

Problem:    Vim9: breakpoint at a comment line does not work.
Solution:   Add the comment line number to the debug instruction.
            (closes #8429)
This commit is contained in:
Bram Moolenaar
2021-06-23 20:20:53 +02:00
parent cc65040986
commit 8cec9273d2
6 changed files with 48 additions and 14 deletions

View File

@@ -947,7 +947,7 @@ func Test_debug_DefFunction()
def LocalFunc()
echo "first"
echo "second"
breakadd func 1 LegacyFunc
breakadd func LegacyFunc
LegacyFunc()
enddef
@@ -1010,6 +1010,13 @@ func Test_debug_def_function()
eval 1
enddef
enddef
def g:FuncComment()
# comment
echo "first"
.. "one"
# comment
echo "second"
enddef
END
call writefile(file, 'Xtest.vim')
@@ -1049,6 +1056,12 @@ func Test_debug_def_function()
\ ['cmd: call FuncWithDict()'])
call RunDbgCmd(buf, 'step', ['line 1: var d = { a: 1, b: 2, }'])
call RunDbgCmd(buf, 'step', ['line 6: def Inner()'])
call RunDbgCmd(buf, 'cont')
call RunDbgCmd(buf, ':breakadd func 1 FuncComment')
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 StopVimInTerminal(buf)