Fix customized extesion in Style Configurator not saved regression

This regression is due to commit:
950236bb8f

Fix #14437
This commit is contained in:
Don Ho 2023-12-03 03:48:05 +01:00
parent 58b2f057b0
commit e08c547167
2 changed files with 11 additions and 7 deletions

View File

@ -284,7 +284,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
{
updateExtension();
notifyDataModified();
// apply(); // apply() function has no effect on adding & modifying user defined extension, but it's just time consuming
apply(false);
}
}
else
@ -1199,17 +1199,21 @@ void WordStyleDlg::restoreGlobalOverrideValues()
}
void WordStyleDlg::apply()
void WordStyleDlg::apply(bool needVisualApply)
{
LexerStylerArray & lsa = (NppParameters::getInstance()).getLStylerArray();
StyleArray & globalStyles = (NppParameters::getInstance()).getGlobalStylers();
lsa = _lsArray;
StyleArray & globalStyles = (NppParameters::getInstance()).getGlobalStylers();
globalStyles = _globalStyles;
if (needVisualApply)
{
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
::SendMessage(_hParent, WM_UPDATEMAINMENUBITMAPS, 0, 0);
}
::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE);
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
::SendMessage(_hParent, WM_UPDATEMAINMENUBITMAPS, 0, 0);
}
void WordStyleDlg::addLastThemeEntry()

View File

@ -66,7 +66,7 @@ public :
void prepare2Cancel();
void redraw(bool forceUpdate = false) const override;
void restoreGlobalOverrideValues();
void apply();
void apply(bool needVisualApply = true);
void addLastThemeEntry();
bool selectThemeByName(const TCHAR* themeName);
bool goToSection(const TCHAR* sectionNames); // sectionNames is formed as following: "Language name:Style name"