diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 678e7dc10..f83379427 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -228,11 +228,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin fileNames.clear(); - generic_string nppThemeDir; - if (!nppParams.isLocal()) - { - nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy - } + generic_string nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy pathAppend(nppThemeDir, TEXT("themes\\")); // Set theme directory to their installation directory diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 17a48c375..a7672feee 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -5607,7 +5607,22 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) { const TCHAR *themePath = element->Attribute(TEXT("path")); if (themePath != NULL && themePath[0]) - _nppGUI._themeName.assign(themePath); + { + // for local/portable setup, only themefilename.xml is needed + // ignore if cloud setting is used + if (_isLocal && !_isCloud) + { + auto themeFileName = ::PathFindFileName(themePath); + generic_string nppThemePath = _nppPath; + pathAppend(nppThemePath, TEXT("themes\\")); + pathAppend(nppThemePath, themeFileName); + _nppGUI._themeName = nppThemePath; + } + else + { + _nppGUI._themeName.assign(themePath); + } + } } else if (!lstrcmp(nm, TEXT("insertDateTime")))