fix: Clicking on data inspector row clearing data inspector window if required size is zero

This commit is contained in:
WerWolv
2026-01-29 19:54:36 +01:00
parent dc1c205fb1
commit 16b02caf7a

View File

@@ -460,7 +460,7 @@ namespace hex::plugin::builtin {
// Handle copying the value to the clipboard when clicking the row
if (ImGui::Selectable("##InspectorLine", m_selectedEntryName == entry.unlocalizedName, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap | ImGuiSelectableFlags_AllowDoubleClick)) {
m_selectedEntryName = entry.unlocalizedName;
if (auto selection = ImHexApi::HexEditor::getSelection(); selection.has_value()) {
if (auto selection = ImHexApi::HexEditor::getSelection(); selection.has_value() && entry.requiredSize > 0) {
ImHexApi::HexEditor::setSelection(Region { .address=selection->getStartAddress(), .size=entry.requiredSize });
}
}