1
0
mirror of synced 2025-01-19 01:24:15 +01:00

impr: Select second to last provider when last one is selected and closed

This commit is contained in:
WerWolv 2024-06-05 23:21:15 +02:00
parent 789d469477
commit 4540e1b561

View File

@ -15,7 +15,6 @@
#include <imgui.h>
#include <imgui_internal.h>
#include <set>
#include <fstream>
#include <algorithm>
#include <GLFW/glfw3.h>
@ -437,8 +436,8 @@ namespace hex {
s_providers->erase(it);
impl::s_closingProviders.erase(provider);
if (s_currentProvider >= i64(s_providers->size()))
setCurrentProvider(0);
if (s_currentProvider >= i64(s_providers->size()) && !s_providers->empty())
setCurrentProvider(s_providers->size() - 1);
if (s_providers->empty())
EventProviderChanged::post(provider, nullptr);