Skip to content

Commit

Permalink
feat: Added shortcuts for the pattern debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Sep 24, 2023
1 parent 181a7c5 commit 89abc85
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/builtin/source/content/views/view_pattern_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,26 @@ namespace hex::plugin::builtin {
this->m_textEditor.SetBreakpoints(breakpoints);
});

/* Trigger evaluation */
ShortcutManager::addGlobalShortcut(Keys::F5 + AllowWhileTyping, [this] {
this->m_triggerAutoEvaluate = true;
});

/* Continue debugger */
ShortcutManager::addGlobalShortcut(SHIFT + Keys::F9 + AllowWhileTyping, [this] {
auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
if (runtime.isRunning())
this->m_breakpointHit = false;
});

/* Step debugger */
ShortcutManager::addGlobalShortcut(SHIFT + Keys::F7 + AllowWhileTyping, [this] {
auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
if (runtime.isRunning()) {
runtime.getInternals().evaluator->pauseNextLine();
this->m_breakpointHit = false;
}
});
}

}

0 comments on commit 89abc85

Please sign in to comment.