diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index fe13c850..7b2f2c47 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -596,7 +596,15 @@ BOOL Notepad_plus::notify(SCNotification *notification) case SCN_UPDATEUI: { NppParameters *nppParam = NppParameters::getInstance(); - + + // replacement for obsolete custom SCN_SCROLLED + if (notification->updated & SC_UPDATE_V_SCROLL) + { + int urlAction = (NppParameters::getInstance())->getNppGUI()._styleURL; + if ((urlAction == 1) || (urlAction == 2)) + addHotSpot(); + } + // if it's searching/replacing, then do nothing if (nppParam->_isFindReplacing) break; @@ -629,19 +637,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) break; } - case SCN_SCROLLED: - { - const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI(); - if (nppGUI._enableSmartHilite) - _smartHighlighter.highlightView(notifyView); - - int urlAction = (NppParameters::getInstance())->getNppGUI()._styleURL; - if ((urlAction == 1) || (urlAction == 2)) - addHotSpot(); - - break; - } - case TTN_GETDISPINFO: { try { diff --git a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp index 98e0a443..1bc5b0df 100644 --- a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp @@ -89,11 +89,8 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView) int firstLine = (int)pHighlightView->execute(SCI_GETFIRSTVISIBLELINE); int nrLines = min((int)pHighlightView->execute(SCI_LINESONSCREEN), MAXLINEHIGHLIGHT ) + 1; int lastLine = firstLine+nrLines; - int startPos = 0;//(int)pHighlightView->execute(SCI_POSITIONFROMLINE, firstLine); - int endPos = 0;//(int)pHighlightView->execute(SCI_POSITIONFROMLINE, lastLine); - //if (endPos == -1) { //past EOF - // endPos = (int)pHighlightView->getCurrentDocLen() - 1; - //} + int startPos = 0; + int endPos = 0; int currentLine = firstLine; int prevDocLineChecked = -1; //invalid start @@ -104,14 +101,11 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView) fo._isWholeWord = true; const TCHAR * searchText = NULL; -#ifdef UNICODE + WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); unsigned int cp = pHighlightView->execute(SCI_GETCODEPAGE); const TCHAR * text2FindW = wmc->char2wchar(text2Find, cp); searchText = text2FindW; -#else - searchText = text2Find; -#endif for(; currentLine < lastLine; ++currentLine) { diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index 5d79fb60..a3359691 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -1047,7 +1047,6 @@ void Editor::ScrollTo(int line, bool moveThumb) { if (moveThumb) { SetVerticalScrollPos(); } - NotifyScrolled(); } } @@ -4520,12 +4519,6 @@ void Editor::NotifyPainted() { NotifyParent(scn); } -void Editor::NotifyScrolled() { - SCNotification scn = {0}; - scn.nmhdr.code = SCN_SCROLLED; - NotifyParent(scn); -} - void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt) { int mask = pdoc->decorations.AllOnFor(position); if ((click && mask) || pdoc->decorations.clickNotified) {