1
0
mirror of synced 2025-01-31 12:03:46 +01:00

ui: Disable Jump To command when too many bytes are selected

This commit is contained in:
WerWolv 2023-01-19 17:08:17 +01:00
parent 58a70f6ad8
commit a9cebed903

View File

@ -1033,8 +1033,7 @@ namespace hex::plugin::builtin {
this->openPopup<PopupRemove>(selection->getStartAddress(), selection->getSize());
}
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.jump_to"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value())) {
if (selection->getSize() <= sizeof(u64)) {
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.jump_to"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value() && selection->getSize() <= sizeof(u64))) {
u64 value = 0;
provider->read(selection->getStartAddress(), &value, selection->getSize());
@ -1043,8 +1042,6 @@ namespace hex::plugin::builtin {
}
}
}
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.open_in_new_provider"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value())) {
auto newProvider = ImHexApi::Provider::createProvider("hex.builtin.provider.view", true);
if (auto *viewProvider = dynamic_cast<ViewProvider*>(newProvider); viewProvider != nullptr) {