[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:
parent
a979745f97
commit
73a6500e63
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user