diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 869d66b8..051a69d5 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -7688,12 +7688,18 @@ bool Notepad_plus::str2Cliboard(const char *str2cpy) return true; } + void Notepad_plus::markSelectedText() { const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI(); if (!nppGUI._enableSmartHilite) return; + //short + if (_pEditView->isSelecting()) + //printStr("catch u!!!"); + return; + // if (_pEditView->getCurrentDocLen() > smartHighlightFileSizeLimit) return; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 40ac09d4..ca40a7da 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -481,6 +481,27 @@ public: bool markerMarginClick(int lineNumber); //true if it did something void notifyMarkers(Buffer * buf, bool isHide, int location, bool del); void runMarkers(bool doHide, int searchStart, bool endOfDoc, bool doDelete); + + bool isSelecting() const { + static CharacterRange previousSelRange = getSelection(); + CharacterRange currentSelRange = getSelection(); + + if (currentSelRange.cpMin == currentSelRange.cpMax) + { + previousSelRange = currentSelRange; + return false; + } + + if ((previousSelRange.cpMin == currentSelRange.cpMin) || (previousSelRange.cpMax == currentSelRange.cpMax)) + { + previousSelRange = currentSelRange; + return true; + } + + previousSelRange = currentSelRange; + return false; + }; + protected: static HINSTANCE _hLib; static int _refCount;