diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 0e6653680..37810da78 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -287,7 +287,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL if (doesFileExist(themePath.c_str())) { nppGUI._themeName.assign(themePath); - nppParams.reloadStylers(themePath.c_str()); + nppParams.reloadStylers(themePath.c_str(), false); ::SendMessage(_hSelf, WM_UPDATESCINTILLAS, TRUE, 0); } } diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index c0b8acc87..bc354b8ec 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -1043,7 +1043,7 @@ NppParameters::~NppParameters() } -bool NppParameters::reloadStylers(const wchar_t* stylePath) +bool NppParameters::reloadStylers(const wchar_t* stylePath, bool doReloadLexerPlugins /*= true*/) { delete _pXmlUserStylerDoc; @@ -1077,9 +1077,12 @@ bool NppParameters::reloadStylers(const wchar_t* stylePath) getUserStylersFromXmlTree(); // Reload plugin styles. - for ( size_t i = 0; i < getExternalLexerDoc()->size(); ++i) + if (doReloadLexerPlugins) { - getExternalLexerFromXmlTree( getExternalLexerDoc()->at(i) ); + for (size_t i = 0; i < getExternalLexerDoc()->size(); ++i) + { + getExternalLexerFromXmlTree(getExternalLexerDoc()->at(i)); + } } return true; } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 5bdd09365..4c5f050a2 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -1524,7 +1524,7 @@ public: bool load(); bool reloadLang(); - bool reloadStylers(const wchar_t *stylePath = nullptr); + bool reloadStylers(const wchar_t* stylePath = nullptr, bool doReloadLexerPlugins = true); void destroyInstance(); std::wstring getSettingsFolder();