From 89abc8557fce5cefdb00c86e630faf0f97460089 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 24 Sep 2023 18:26:42 +0200 Subject: [PATCH] feat: Added shortcuts for the pattern debugger --- .../content/views/view_pattern_editor.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 5af60f75c0a71..155d3574c0f96 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -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; + } + }); } } \ No newline at end of file