Commit da65262e authored by yann300's avatar yann300

use initialline instead of previous line

parent 658a98db
......@@ -15,8 +15,7 @@ export class BreakpointManager {
solidityProxy
breakpoints
locationToRowConverter
previousLine
/**
* constructor
*
......@@ -92,22 +91,25 @@ export class BreakpointManager {
let previousSourceLocation
let currentStep = fromStep + direction
let lineHadBreakpoint = false
let initialLine
while (currentStep > 0 && currentStep < trace.length) {
try {
previousSourceLocation = sourceLocation
sourceLocation = await this.callTree.extractValidSourceLocation(currentStep)
} catch (e) {
return console.log('cannot jump to breakpoint ' + e)
console.log('cannot jump to breakpoint ' + e)
currentStep += direction
}
const lineColumn = await this.locationToRowConverter(sourceLocation)
if (this.previousLine !== lineColumn.start.line) {
if (!initialLine) initialLine = lineColumn
if (initialLine.start.line !== lineColumn.start.line) {
if (direction === -1 && lineHadBreakpoint) { // TODO : improve this when we will build the correct structure before hand
lineHadBreakpoint = false
if (this.hitLine(currentStep + 1, previousSourceLocation, sourceLocation, trace)) {
return
}
}
this.previousLine = lineColumn.start.line
if (this.hasBreakpointAtLine(sourceLocation.file, lineColumn.start.line)) {
lineHadBreakpoint = true
if (direction === 1 && this.hitLine(currentStep, sourceLocation, previousSourceLocation, trace)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment