mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
impr: Handle provider opening more centrally, switch to existing provider if same file is being opened again
(cherry picked from commit 89004574d3)
This commit is contained in:
@@ -524,7 +524,6 @@ namespace hex::plugin::builtin {
|
||||
flags |= ImGuiTabItemFlags_UnsavedDocument;
|
||||
if (i64(i) == selectedProviderIndex && providerJustChanged) {
|
||||
flags |= ImGuiTabItemFlags_SetSelected;
|
||||
providerJustChanged = false;
|
||||
}
|
||||
|
||||
static size_t lastSelectedProvider = 0;
|
||||
@@ -535,7 +534,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (isSelected && lastSelectedProvider != i) {
|
||||
if (isSelected && lastSelectedProvider != i && !providerJustChanged) {
|
||||
ImHexApi::Provider::setCurrentProvider(i);
|
||||
lastSelectedProvider = i;
|
||||
}
|
||||
@@ -555,6 +554,8 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
|
||||
providerJustChanged = false;
|
||||
}
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
Reference in New Issue
Block a user