mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
fix: Modification highlighting not working correctly when provider data was moved
This commit is contained in:
@@ -9,7 +9,7 @@ namespace hex::plugin::builtin {
|
||||
class ViewPatches : public View::Window {
|
||||
public:
|
||||
explicit ViewPatches();
|
||||
~ViewPatches() override = default;
|
||||
~ViewPatches() override;
|
||||
|
||||
void drawContent() override;
|
||||
void drawAlwaysVisibleContent() override;
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
});
|
||||
|
||||
MovePerProviderData::subscribe(this, [this](prv::Provider *from, prv::Provider *to) {
|
||||
m_savedOperations.get(from) = 0;
|
||||
m_savedOperations.get(to) = 0;
|
||||
});
|
||||
|
||||
ImHexApi::HexEditor::addForegroundHighlightingProvider([this](u64 offset, const u8* buffer, size_t, bool) -> std::optional<color_t> {
|
||||
hex::unused(buffer);
|
||||
|
||||
@@ -104,6 +109,15 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
}
|
||||
|
||||
ViewPatches::~ViewPatches() {
|
||||
MovePerProviderData::unsubscribe(this);
|
||||
EventProviderSaved::unsubscribe(this);
|
||||
EventProviderDataModified::unsubscribe(this);
|
||||
EventProviderDataInserted::unsubscribe(this);
|
||||
EventProviderDataRemoved::unsubscribe(this);
|
||||
}
|
||||
|
||||
|
||||
void ViewPatches::drawContent() {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user