ui: Disable Jump To command when too many bytes are selected
This commit is contained in:
parent
58a70f6ad8
commit
a9cebed903
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user