mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
[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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Notepad_plus::markSelectedText()
|
void Notepad_plus::markSelectedText()
|
||||||
{
|
{
|
||||||
const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI();
|
const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI();
|
||||||
if (!nppGUI._enableSmartHilite)
|
if (!nppGUI._enableSmartHilite)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//short
|
||||||
|
if (_pEditView->isSelecting())
|
||||||
|
//printStr("catch u!!!");
|
||||||
|
return;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (_pEditView->getCurrentDocLen() > smartHighlightFileSizeLimit)
|
if (_pEditView->getCurrentDocLen() > smartHighlightFileSizeLimit)
|
||||||
return;
|
return;
|
||||||
|
@ -481,6 +481,27 @@ public:
|
|||||||
bool markerMarginClick(int lineNumber); //true if it did something
|
bool markerMarginClick(int lineNumber); //true if it did something
|
||||||
void notifyMarkers(Buffer * buf, bool isHide, int location, bool del);
|
void notifyMarkers(Buffer * buf, bool isHide, int location, bool del);
|
||||||
void runMarkers(bool doHide, int searchStart, bool endOfDoc, bool doDelete);
|
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:
|
protected:
|
||||||
static HINSTANCE _hLib;
|
static HINSTANCE _hLib;
|
||||||
static int _refCount;
|
static int _refCount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user