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)
diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim
index 7938d91..1d100e0 100644
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -2176,7 +2176,9 @@
enddef
def s:Profiled(): string
+ # comment
echo "profiled"
+ # comment
var some = "some text"
return "done"
enddef
@@ -2187,18 +2189,20 @@
endif
var res = execute('disass profile s:Profiled')
assert_match('<SNR>\d*_Profiled\_s*' ..
+ '# comment\_s*' ..
'echo "profiled"\_s*' ..
- '\d PROFILE START line 1\_s*' ..
+ '\d PROFILE START line 2\_s*' ..
'\d PUSHS "profiled"\_s*' ..
'\d ECHO 1\_s*' ..
+ '# comment\_s*' ..
'var some = "some text"\_s*' ..
'\d PROFILE END\_s*' ..
- '\d PROFILE START line 2\_s*' ..
+ '\d PROFILE START line 4\_s*' ..
'\d PUSHS "some text"\_s*' ..
'\d STORE $0\_s*' ..
'return "done"\_s*' ..
'\d PROFILE END\_s*' ..
- '\d PROFILE START line 3\_s*' ..
+ '\d PROFILE START line 5\_s*' ..
'\d PUSHS "done"\_s*' ..
'\d\+ RETURN\_s*' ..
'\d\+ PROFILE END',
@@ -2208,16 +2212,18 @@
def Test_debugged()
var res = execute('disass debug s:Profiled')
assert_match('<SNR>\d*_Profiled\_s*' ..
+ '# comment\_s*' ..
'echo "profiled"\_s*' ..
- '\d DEBUG line 1 varcount 0\_s*' ..
+ '\d DEBUG line 1-2 varcount 0\_s*' ..
'\d PUSHS "profiled"\_s*' ..
'\d ECHO 1\_s*' ..
+ '# comment\_s*' ..
'var some = "some text"\_s*' ..
- '\d DEBUG line 2 varcount 0\_s*' ..
+ '\d DEBUG line 3-4 varcount 0\_s*' ..
'\d PUSHS "some text"\_s*' ..
'\d STORE $0\_s*' ..
'return "done"\_s*' ..
- '\d DEBUG line 3 varcount 1\_s*' ..
+ '\d DEBUG line 5-5 varcount 1\_s*' ..
'\d PUSHS "done"\_s*' ..
'\d RETURN\_s*',
res)