Browse Source

[BUG_FIXED] Fix external lexer plugin loading problem for Unicode Notepad++.

Add new plugin notification message NPPN_WORDSTYLESUPDATED.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@383 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 16 years ago
parent
commit
44219af45d
  1. 4
      PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
  2. 7
      PowerEditor/src/Notepad_plus.cpp
  3. 10
      scintilla/src/Editor.cxx

4
PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h

@ -407,6 +407,10 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = currentBufferID;
#define NPPN_WORDSTYLESUPDATED (NPPN_FIRST + 12) // To notify plugins that user initiated a WordStyleDlg change.
//scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = currentBufferID;
#endif //NOTEPAD_PLUS_MSGS_H

7
PowerEditor/src/Notepad_plus.cpp

@ -7804,6 +7804,13 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
_subEditView.performGlobalStyles();
drawTabbarColoursFromStylerArray();
// Notify plugins of update to styles xml
SCNotification scnN;
scnN.nmhdr.code = NPPN_WORDSTYLESUPDATED;
scnN.nmhdr.hwndFrom = _hSelf;
scnN.nmhdr.idFrom = (uptr_t) _pEditView->getCurrentBufferID();
_pluginsManager.notify(&scnN);
return TRUE;
}

10
scintilla/src/Editor.cxx

@ -3500,6 +3500,16 @@ void Editor::ClearAll() {
}
void Editor::ClearDocumentStyle() {
Decoration *deco = pdoc->decorations.root;
while (deco) {
// Save next in case deco deleted
Decoration *decoNext = deco->next;
if (deco->indicator < INDIC_CONTAINER) {
pdoc->decorations.SetCurrentIndicator(deco->indicator);
pdoc->DecorationFillRange(0, 0, pdoc->Length());
}
deco = decoNext;
}
pdoc->StartStyling(0, '\377');
pdoc->SetStyleFor(pdoc->Length(), 0);
cs.ShowAll();

Loading…
Cancel
Save