Fix URL detecting issue

... while URL is in first line of document.

Fix #8668, close Fixes #8669
This commit is contained in:
Udo Hoffmann 2020-08-05 16:00:11 +02:00 committed by Don HO
parent 1eb7d2bef5
commit 6e5a2d5be2
1 changed files with 6 additions and 3 deletions

View File

@ -2280,9 +2280,12 @@ void ScintillaEditView::getVisibleStartAndEndPosition(int * startPos, int * endP
// Get the position of the 1st and last showing chars from the edit view
RECT rcEditView;
getClientRect(rcEditView);
*startPos = static_cast<int32_t>(execute(SCI_POSITIONFROMPOINT, 0, 0));
*endPos = static_cast<int32_t>(execute(SCI_POSITIONFROMPOINT, rcEditView.right - rcEditView.left, rcEditView.bottom - rcEditView.top));
LRESULT pos = execute(SCI_POSITIONFROMPOINT, 0, 0);
LRESULT line = execute(SCI_LINEFROMPOSITION, pos);
*startPos = static_cast<int32_t>(execute(SCI_POSITIONFROMLINE, line));
pos = execute(SCI_POSITIONFROMPOINT, rcEditView.right - rcEditView.left, rcEditView.bottom - rcEditView.top);
line = execute(SCI_LINEFROMPOSITION, pos);
*endPos = static_cast<int32_t>(execute(SCI_GETLINEENDPOSITION, line));
}
char * ScintillaEditView::getWordFromRange(char * txt, int size, int pos1, int pos2)