parent
413762c393
commit
9c8497a99d
@ -820,8 +820,13 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||||||
else
|
else
|
||||||
{ // Double click with no modifiers
|
{ // Double click with no modifiers
|
||||||
// Check wether cursor is within URL
|
// Check wether cursor is within URL
|
||||||
int startPos = 0, endPos = 0;
|
auto indicMsk = notifyView->execute(SCI_INDICATORALLONFOR, notification->position);
|
||||||
if (!notifyView->getIndicatorRange(URL_INDIC, &startPos, &endPos))
|
if (!(indicMsk & (1 << URL_INDIC)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
auto startPos = notifyView->execute(SCI_INDICATORSTART, URL_INDIC, notification->position);
|
||||||
|
auto endPos = notifyView->execute(SCI_INDICATOREND, URL_INDIC, notification->position);
|
||||||
|
if ((notification->position < startPos) || (notification->position > endPos))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// WM_LBUTTONUP goes to opening browser instead of Scintilla here, because the mouse is not captured.
|
// WM_LBUTTONUP goes to opening browser instead of Scintilla here, because the mouse is not captured.
|
||||||
|
@ -3327,6 +3327,22 @@ void ScintillaEditView::foldChanged(size_t line, int levelNow, int levelPrev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScintillaEditView::getIndicatorRange(int indicatorNumber, int *from, int *to, int *cur)
|
||||||
|
{
|
||||||
|
int curPos = static_cast<int>(execute(SCI_GETCURRENTPOS));
|
||||||
|
int indicMsk = static_cast<int>(execute(SCI_INDICATORALLONFOR, curPos));
|
||||||
|
if (!(indicMsk & (1 << indicatorNumber)))
|
||||||
|
return false;
|
||||||
|
int startPos = static_cast<int>(execute(SCI_INDICATORSTART, indicatorNumber, curPos));
|
||||||
|
int endPos = static_cast<int>(execute(SCI_INDICATOREND, indicatorNumber, curPos));
|
||||||
|
if ((curPos < startPos) || (curPos > endPos))
|
||||||
|
return false;
|
||||||
|
if (from) *from = startPos;
|
||||||
|
if (to) *to = endPos;
|
||||||
|
if (cur) *cur = curPos;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
void ScintillaEditView::scrollPosToCenter(size_t pos)
|
void ScintillaEditView::scrollPosToCenter(size_t pos)
|
||||||
{
|
{
|
||||||
|
@ -559,20 +559,7 @@ public:
|
|||||||
execute(SCI_INDICATORCLEARRANGE, docStart, docEnd-docStart);
|
execute(SCI_INDICATORCLEARRANGE, docStart, docEnd-docStart);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool getIndicatorRange(int indicatorNumber, int *from = NULL, int *to = NULL, int *cur = NULL) {
|
bool getIndicatorRange(int indicatorNumber, int *from = NULL, int *to = NULL, int *cur = NULL);
|
||||||
int curPos = static_cast<int>(execute(SCI_GETCURRENTPOS));
|
|
||||||
int indicMsk = static_cast<int>(execute(SCI_INDICATORALLONFOR, curPos));
|
|
||||||
if (!(indicMsk & (1 << indicatorNumber)))
|
|
||||||
return false;
|
|
||||||
int startPos = static_cast<int>(execute(SCI_INDICATORSTART, indicatorNumber, curPos));
|
|
||||||
int endPos = static_cast<int>(execute(SCI_INDICATOREND, indicatorNumber, curPos));
|
|
||||||
if ((curPos < startPos) || (curPos > endPos))
|
|
||||||
return false;
|
|
||||||
if (from) *from = startPos;
|
|
||||||
if (to) *to = endPos;
|
|
||||||
if (cur) *cur = curPos;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
static LanguageName langNames[L_EXTERNAL+1];
|
static LanguageName langNames[L_EXTERNAL+1];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user