1
0
mirror of synced 2025-01-19 09:27:32 +01:00

impr: Added code so that when debugger pauses at a line, the line is highlighted (#1932)

regardless of the method used to pause the evaluation at that line.
This commit is contained in:
paxcut 2024-11-24 03:29:08 -07:00 committed by GitHub
parent 4fcf732814
commit 6464377a89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1738,10 +1738,13 @@ namespace hex::plugin::builtin {
auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
ContentRegistry::PatternLanguage::configureRuntime(runtime, provider);
runtime.getInternals().evaluator->setBreakpointHitCallback([this]{
runtime.getInternals().evaluator->setBreakpointHitCallback([this, &runtime] {
m_debuggerScopeIndex = 0;
*m_breakpointHit = true;
m_resetDebuggerVariables = true;
auto optPauseLine = runtime.getInternals().evaluator->getPauseLine();
if (optPauseLine.has_value())
m_textEditor.SetCursorPosition({ static_cast<int>(optPauseLine.value())-1, 0 });
while (*m_breakpointHit) {
std::this_thread::sleep_for(std::chrono::milliseconds(100LL));
}