Skip to content

Commit

Permalink
Fix customized extesion in Style Configurator not saved regression
Browse files Browse the repository at this point in the history
This regression is due to commit:
notepad-plus-plus@950236b

Fix notepad-plus-plus#14437
  • Loading branch information
donho committed Dec 3, 2023
1 parent 58b2f05 commit e08c547
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e08c547

Please sign in to comment.