[ENHANCE] Make smart highlight work only with mouse double clicked in order to improve the its performance.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@230 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-06-13 16:17:04 +00:00
parent a979745f97
commit 73a6500e63
2 changed files with 27 additions and 0 deletions

View File

@ -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;

View File

@ -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;