mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
fix: Edit -> Create Bookmark shortcut creating bookmark at wrong address
This commit is contained in:
@@ -250,14 +250,11 @@ namespace hex::plugin::builtin {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.edit", 1050, [&] {
|
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.edit", 1050, [&] {
|
||||||
auto provider = ImHexApi::Provider::get();
|
|
||||||
bool providerValid = ImHexApi::Provider::isValid();
|
bool providerValid = ImHexApi::Provider::isValid();
|
||||||
auto selection = ImHexApi::HexEditor::getSelection();
|
auto selection = ImHexApi::HexEditor::getSelection();
|
||||||
|
|
||||||
if (ImGui::MenuItem("hex.builtin.menu.edit.bookmark"_lang, nullptr, false, selection.has_value() && providerValid)) {
|
if (ImGui::MenuItem("hex.builtin.menu.edit.bookmark"_lang, nullptr, false, selection.has_value() && providerValid)) {
|
||||||
auto base = provider->getBaseAddress();
|
ImHexApi::Bookmarks::add(selection->getStartAddress(), selection->getSize(), {}, {});
|
||||||
|
|
||||||
ImHexApi::Bookmarks::add(base + selection->getStartAddress(), selection->size, {}, {});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ namespace hex::plugin::builtin {
|
|||||||
auto region = ImHexApi::HexEditor::getSelection();
|
auto region = ImHexApi::HexEditor::getSelection();
|
||||||
|
|
||||||
if (region.has_value())
|
if (region.has_value())
|
||||||
ImHexApi::Bookmarks::add(region->address, region->size, {}, {});
|
ImHexApi::Bookmarks::add(region->getStartAddress(), region->getSize(), {}, {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|||||||
Reference in New Issue
Block a user