Fix URL is not clickable in certain stuation while wrapped is enabled

Fix #5503, close #8467
This commit is contained in:
Udo Hoffmann 2020-06-25 00:20:02 +02:00 committed by Don HO
parent 5a2cabf14e
commit b935bc6bf3
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -2257,15 +2257,12 @@ void ScintillaEditView::replaceSelWith(const char * replaceText)
void ScintillaEditView::getVisibleStartAndEndPosition(int * startPos, int * endPos)
{
assert(startPos != NULL && endPos != NULL);
// 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));
auto firstVisibleLine = execute(SCI_GETFIRSTVISIBLELINE);
*startPos = static_cast<int32_t>(execute(SCI_POSITIONFROMLINE, execute(SCI_DOCLINEFROMVISIBLE, firstVisibleLine)));
auto linesOnScreen = execute(SCI_LINESONSCREEN);
auto lineCount = execute(SCI_GETLINECOUNT);
auto visibleLine = execute(SCI_DOCLINEFROMVISIBLE, firstVisibleLine + min(linesOnScreen, lineCount));
*endPos = static_cast<int32_t>(execute(SCI_POSITIONFROMLINE, visibleLine));
if (*endPos == -1)
*endPos = static_cast<int32_t>(execute(SCI_GETLENGTH));
}
char * ScintillaEditView::getWordFromRange(char * txt, int size, int pos1, int pos2)