From e8b93575bee5a32b6bb8892210fdbd5e9143f536 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 16 Jul 2025 22:11:56 +0200 Subject: [PATCH] Revert "Fix "Follow Windows" option makes external lexers show twice in tab settings" Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16462#issuecomment-3079457421 This reverts commit f234207f5dd8f45ecd97cb08a21aa993e7469b65. --- PowerEditor/src/Notepad_plus_Window.cpp | 2 +- PowerEditor/src/Parameters.cpp | 9 +++------ PowerEditor/src/Parameters.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 37810da78..0e6653680 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(), false); + nppParams.reloadStylers(themePath.c_str()); ::SendMessage(_hSelf, WM_UPDATESCINTILLAS, TRUE, 0); } } diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index bc354b8ec..c0b8acc87 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 doReloadLexerPlugins /*= true*/) +bool NppParameters::reloadStylers(const wchar_t* stylePath) { delete _pXmlUserStylerDoc; @@ -1077,12 +1077,9 @@ bool NppParameters::reloadStylers(const wchar_t* stylePath, bool doReloadLexerPl getUserStylersFromXmlTree(); // Reload plugin styles. - if (doReloadLexerPlugins) + for ( size_t i = 0; i < getExternalLexerDoc()->size(); ++i) { - for (size_t i = 0; i < getExternalLexerDoc()->size(); ++i) - { - getExternalLexerFromXmlTree(getExternalLexerDoc()->at(i)); - } + getExternalLexerFromXmlTree( getExternalLexerDoc()->at(i) ); } return true; } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 4c5f050a2..5bdd09365 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 doReloadLexerPlugins = true); + bool reloadStylers(const wchar_t *stylePath = nullptr); void destroyInstance(); std::wstring getSettingsFolder();