Fixed a bug appearing when selecting over multiple lines in different directions.

This commit is contained in:
Cranken 2018-10-06 14:38:17 +02:00 committed by pajlada
parent 4c4d1d2042
commit 423ef19c8f

View file

@ -899,13 +899,23 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
if (wordStart < this->selection_.start.charIndex &&
!this->dCSelection_.selectingRight) {
this->dCSelection_.selectingLeft = true;
if (wordStart > this->dCSelection_.originalEnd) {
this->setSelection(this->dCSelection_.origStartItem,
newEnd);
} else {
this->setSelection(newStart, this->selection_.end);
}
// Selecting to the right
} else if (wordEnd > this->selection_.end.charIndex &&
!this->dCSelection_.selectingLeft) {
this->dCSelection_.selectingRight = true;
if (wordEnd < this->dCSelection_.originalStart) {
this->setSelection(newStart,
this->dCSelection_.origEndItem);
} else {
this->setSelection(this->selection_.start, newEnd);
}
}
// Swapping from selecting left to selecting right
if (wordStart > this->selection_.start.charIndex &&
!this->dCSelection_.selectingRight) {