From 6a146e239ad12e7a6a8f1c314a0cd4643c42161a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 29 Jan 2024 20:50:00 +0100 Subject: [PATCH] fix: Workspaces not being exported correctly --- lib/libimhex/source/api/workspace_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libimhex/source/api/workspace_manager.cpp b/lib/libimhex/source/api/workspace_manager.cpp index edf1087a3..fc0b5c87b 100644 --- a/lib/libimhex/source/api/workspace_manager.cpp +++ b/lib/libimhex/source/api/workspace_manager.cpp @@ -16,10 +16,10 @@ namespace hex { decltype(WorkspaceManager::s_workspaces)::iterator WorkspaceManager::s_previousWorkspace = s_workspaces.end(); void WorkspaceManager::createWorkspace(const std::string& name, const std::string &layout) { - s_workspaces[name] = Workspace { + s_currentWorkspace = s_workspaces.insert_or_assign(name, Workspace { .layout = layout.empty() ? LayoutManager::saveToString() : layout, .path = {} - }; + }).first; for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Workspaces)) { if (exportToFile(path / (name + ".hexws")))