diff --git a/plugins/builtin/include/ui/hex_editor.hpp b/plugins/builtin/include/ui/hex_editor.hpp index 40e92d576..d3a1390b2 100644 --- a/plugins/builtin/include/ui/hex_editor.hpp +++ b/plugins/builtin/include/ui/hex_editor.hpp @@ -25,7 +25,10 @@ namespace hex::plugin::builtin::ui { ~HexEditor(); void draw(float height = ImGui::GetContentRegionAvail().y); - void setProvider(prv::Provider *provider) { this->m_provider = provider; } + void setProvider(prv::Provider *provider) { + this->m_provider = provider; + this->m_currValidRegion = { Region::Invalid(), false }; + } void setUnknownDataCharacter(char character) { this->m_unknownDataCharacter = character; } private: enum class CellType { None, Hex, ASCII }; diff --git a/plugins/builtin/source/ui/hex_editor.cpp b/plugins/builtin/source/ui/hex_editor.cpp index df49ed81a..a0fa24d3e 100644 --- a/plugins/builtin/source/ui/hex_editor.cpp +++ b/plugins/builtin/source/ui/hex_editor.cpp @@ -358,7 +358,7 @@ namespace hex::plugin::builtin::ui { ImGui::TableNextColumn(); if (this->m_provider != nullptr && this->m_provider->isReadable()) { - const auto isCurrRegionValid = [this](u64 address){ + const auto isCurrRegionValid = [this](u64 address) { auto &[currRegion, currRegionValid] = this->m_currValidRegion; if (!Region{ address, 1 }.isWithin(currRegion)) { this->m_currValidRegion = this->m_provider->getRegionValidity(address);