fix: Properly clear valid region when switching to a different provider
This commit is contained in:
parent
be16b66ac0
commit
f3f0dda3d4
@ -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 };
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user