From 44219af45d0c752ce321dfe3de0831e49bb84d58 Mon Sep 17 00:00:00 2001 From: donho Date: Sat, 3 Jan 2009 18:57:51 +0000 Subject: [PATCH] [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 --- .../src/MISC/PluginsManager/Notepad_plus_msgs.h | 4 ++++ PowerEditor/src/Notepad_plus.cpp | 7 +++++++ scintilla/src/Editor.cxx | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 3e9f1857e..14b2bab0a 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/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 diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 8f2044719..b4d324fe2 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/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; } diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index a54d1632e..908d0b314 100644 --- a/scintilla/src/Editor.cxx +++ b/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();