From af586d5410af56d433717b54371dbd284bb02416 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 2 Oct 2016 18:34:40 -0500 Subject: [PATCH] add use-ConEmu.xml --- launcher/src/CmderLauncher.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 24f35c8..a16bbc2 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -118,15 +118,25 @@ void StartCmder(std::wstring path, bool is_single_mode) PathCombine(icoPath, exeDir, L"icons\\cmder.ico"); // Check for machine-specific config file. - PathCombine(oldCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml"); - ExpandEnvironmentStrings(oldCfgPath, oldCfgPath, sizeof(oldCfgPath) / sizeof(oldCfgPath[0])); - if (!PathFileExists(oldCfgPath)) { + PathCombine(cpuCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml"); + ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0])); + + // Check for user-specific config file. + PathCombine(userCfgPath, exeDir, L"config\\user-ConEmu.xml"); + + if (PathFileExists(cpuCfgPath)) { + PathCombine(oldCfgPath, exeDir, cpuCfgPath.GetBuffer(sizeof(cpuCfgPath))); + } + else if (!PathFileExists(userCfgPath)) { + PathCombine(oldCfgPath, exeDir, userCfgPath.GetBuffer(sizeof(userCfgPath))); + } + else { PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml"); - } + } // Check for machine-specific config file. - PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu-%COMPUTERNAME%.xml"); - ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0])); + PathCombine(cfgPath, exeDir, oldCfgPath.GetBufer(sizeof(oldCfgPath); + // ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0])); if (!PathFileExists(cfgPath)) { PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml"); }