diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index 25f5d441f..3f8cef5b1 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -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() diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 9529f0c59..04f94b3a5 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -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"