mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 20:23:41 +08:00
Handle 'next'ing in deferred funcs
This commit is contained in:
@ -196,7 +196,7 @@ func (s *Searcher) NextLines(fname string, line int) (lines []int, err error) {
|
||||
return true
|
||||
}
|
||||
|
||||
if dn, ok := n.(*ast.DeferStmt); ok {
|
||||
if dn, ok := n.(*ast.DeferStmt); ok && line < pos.Line {
|
||||
endpos := s.fileset.Position(dn.End())
|
||||
deferEndLine = endpos.Line
|
||||
return false
|
||||
|
||||
@ -41,6 +41,7 @@ func TestNextLines(t *testing.T) {
|
||||
{30, []int{32}},
|
||||
{62, []int{63}},
|
||||
{67, []int{71}},
|
||||
{68, []int{69}},
|
||||
}
|
||||
for i, c := range cases {
|
||||
lines, err := v.NextLines(tf, c.line)
|
||||
|
||||
Reference in New Issue
Block a user