mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Optimize hovering over patterns in the hex editor
This commit is contained in:
@@ -521,6 +521,10 @@ namespace hex::plugin::builtin {
|
||||
|
||||
m_hexEditor.setHoverChangedCallback([this](u64 address, size_t size) {
|
||||
m_hoverHighlights->clear();
|
||||
|
||||
if (Region(address, size) == Region::Invalid())
|
||||
return;
|
||||
|
||||
for (const auto &[id, hoverFunction] : ImHexApi::HexEditor::impl::getHoveringFunctions()) {
|
||||
auto highlightedAddresses = hoverFunction(m_hexEditor.getProvider(), address, size);
|
||||
m_hoverHighlights->merge(highlightedAddresses);
|
||||
|
||||
@@ -555,7 +555,7 @@ namespace hex::plugin::builtin {
|
||||
if (m_hasUnevaluatedChanges && m_runningEvaluators == 0 && m_runningParsers == 0) {
|
||||
m_hasUnevaluatedChanges = false;
|
||||
|
||||
auto code = m_textEditor.GetText();
|
||||
const auto &code = m_textEditor.GetText();
|
||||
EventPatternEditorChanged::post(code);
|
||||
|
||||
TaskManager::createBackgroundTask("hex.builtin.task.parsing_pattern"_lang, [this, code, provider](auto &){
|
||||
|
||||
Reference in New Issue
Block a user