comparison src/testdir/test_debugger.vim @ 25004:70f55a30f03c v8.2.3039

patch 8.2.3039: Vim9: breakpoint at a comment line does not work Commit: https://github.com/vim/vim/commit/8cec9273d2518f2a9abcbd326722a2eba38d2a13 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 23 20:20:53 2021 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Jun 2021 20:30:03 +0200
parents 2cb78583fada
children 671ded1facd5
comparison
equal deleted inserted replaced
25003:264025157c93 25004:70f55a30f03c
945 enddef 945 enddef
946 946
947 def LocalFunc() 947 def LocalFunc()
948 echo "first" 948 echo "first"
949 echo "second" 949 echo "second"
950 breakadd func 1 LegacyFunc 950 breakadd func LegacyFunc
951 LegacyFunc() 951 LegacyFunc()
952 enddef 952 enddef
953 953
954 func LegacyFunc() 954 func LegacyFunc()
955 echo "legone" 955 echo "legone"
1007 } 1007 }
1008 # comment 1008 # comment
1009 def Inner() 1009 def Inner()
1010 eval 1 1010 eval 1
1011 enddef 1011 enddef
1012 enddef
1013 def g:FuncComment()
1014 # comment
1015 echo "first"
1016 .. "one"
1017 # comment
1018 echo "second"
1012 enddef 1019 enddef
1013 END 1020 END
1014 call writefile(file, 'Xtest.vim') 1021 call writefile(file, 'Xtest.vim')
1015 1022
1016 let buf = RunVimInTerminal('-S Xtest.vim', {}) 1023 let buf = RunVimInTerminal('-S Xtest.vim', {})
1047 call RunDbgCmd(buf, 1054 call RunDbgCmd(buf,
1048 \ ':debug call FuncWithDict()', 1055 \ ':debug call FuncWithDict()',
1049 \ ['cmd: call FuncWithDict()']) 1056 \ ['cmd: call FuncWithDict()'])
1050 call RunDbgCmd(buf, 'step', ['line 1: var d = { a: 1, b: 2, }']) 1057 call RunDbgCmd(buf, 'step', ['line 1: var d = { a: 1, b: 2, }'])
1051 call RunDbgCmd(buf, 'step', ['line 6: def Inner()']) 1058 call RunDbgCmd(buf, 'step', ['line 6: def Inner()'])
1059 call RunDbgCmd(buf, 'cont')
1060
1061 call RunDbgCmd(buf, ':breakadd func 1 FuncComment')
1062 call RunDbgCmd(buf, ':call FuncComment()', ['function FuncComment', 'line 2: echo "first" .. "one"'])
1063 call RunDbgCmd(buf, ':breakadd func 3 FuncComment')
1064 call RunDbgCmd(buf, 'cont', ['function FuncComment', 'line 5: echo "second"'])
1052 1065
1053 call RunDbgCmd(buf, 'cont') 1066 call RunDbgCmd(buf, 'cont')
1054 call StopVimInTerminal(buf) 1067 call StopVimInTerminal(buf)
1055 call delete('Xtest.vim') 1068 call delete('Xtest.vim')
1056 endfunc 1069 endfunc