Skip to content

Commit 0c88f05

Browse files
committed
Register new sources in startExecuting before exec instead of after
Fixes an issue where the first pattern would be placed in a different source than the rest.
1 parent f63564d commit 0c88f05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Common/src/main/kotlin/gay/object/hexdebug/debugger/HexDebugger.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,18 +402,18 @@ class HexDebugger(
402402
}
403403
nextContinuation = newContinuation.pushFrame(FrameEvaluate(SpellList.LList(0, iotas), false))
404404

405+
val newSource = registerNewSource(iotas)
406+
405407
val stopReason = when {
406408
isStarting && launchArgs.stopOnEntry -> StopReason.STARTED
407409
isAtBreakpoint() -> StopReason.BREAKPOINT
408410
isPausing -> StopReason.PAUSE
409411
lastRequestStepType != null -> StopReason.STEP
410412
else -> null
411413
}
412-
var result = stopReason?.let(::DebugStepResult) ?: executeUntilStopped()
413414

414-
registerNewSource(iotas)?.let {
415-
result = result.withLoadedSource(it, LoadedSourceReason.NEW)
416-
}
415+
var result = stopReason?.let(::DebugStepResult) ?: executeUntilStopped()
416+
newSource?.let { result = result.withLoadedSource(it, LoadedSourceReason.NEW) }
417417

418418
return result
419419
}

0 commit comments

Comments
 (0)