1
0
mirror of synced 2024-11-13 18:50:53 +01:00

fix: Highlighting not being cleared correctly in some cases

This commit is contained in:
WerWolv 2023-09-12 22:23:47 +02:00
parent 5e86f62a98
commit da18428f27
2 changed files with 10 additions and 1 deletions

View File

@ -39,6 +39,7 @@ namespace hex::plugin::builtin {
ImHexApi::Provider::markDirty();
EventManager::post<EventBookmarkCreated>(this->m_bookmarks->back());
EventManager::post<EventHighlightingChanged>();
});
// Draw hex editor background highlights for bookmarks
@ -374,6 +375,7 @@ namespace hex::plugin::builtin {
// Remove the bookmark that was marked for removal
if (bookmarkToRemove != this->m_bookmarks->end()) {
this->m_bookmarks->erase(bookmarkToRemove);
EventManager::post<EventHighlightingChanged>();
}
}
ImGui::EndChild();

View File

@ -451,6 +451,7 @@ namespace hex::plugin::builtin {
}
this->m_occurrenceTree->clear();
EventManager::post<EventHighlightingChanged>();
this->m_searchTask = TaskManager::createTask("hex.builtin.view.find.searching", searchRegion.getSize(), [this, settings = this->m_searchSettings, searchRegion](auto &task) {
auto provider = ImHexApi::Provider::get();
@ -478,6 +479,10 @@ namespace hex::plugin::builtin {
for (const auto &occurrence : this->m_foundOccurrences.get(provider))
this->m_occurrenceTree->insert({ occurrence.region.getStartAddress(), occurrence.region.getEndAddress() }, occurrence);
TaskManager::doLater([] {
EventManager::post<EventHighlightingChanged>();
});
});
}
@ -821,7 +826,9 @@ namespace hex::plugin::builtin {
if (ImGui::Button("hex.builtin.view.find.search.reset"_lang)) {
this->m_foundOccurrences->clear();
this->m_sortedOccurrences->clear();
*this->m_occurrenceTree = {};
this->m_occurrenceTree->clear();
EventManager::post<EventHighlightingChanged>();
}
}
ImGui::EndDisabled();