Fix word selection mode

Test Plan:
* run `printf '%.0skonsole ' $(seq 200)` to generate some words
* double click on the beginning of any word
* move mouse pointer right/bottom to extend selection

Expected result: the selection should extend word by word, with the
selection end being on the left or right side of a word located under
pointer

Actual result: right selection end extends character by character and
is located at fixed offset from the pointer

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, ngraham, konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12939
wilder-portage
Mariusz Glebocki 8 years ago committed by Kurt Hindenburg
parent 5128781a82
commit f24aa818f9
  1. 2
      src/TerminalDisplay.cpp

@ -2504,7 +2504,7 @@ void TerminalDisplay::extendSelection(const QPoint& position)
// Find left (left_not_right ? from start : from here)
QPoint right = left_not_right ? _iPntSelCorr : here;
i = loc(qBound(0, left.x(), _columns - 1), qBound(0, left.y(), _lines - 1));
i = loc(qBound(0, right.x(), _columns - 1), qBound(0, right.y(), _lines - 1));
if (i >= 0 && i < _imageSize) {
selClass = charClass(_image[qMin(i, _imageSize - 1)]);
while (((right.x() < _usedColumns - 1) || (right.y() < _usedLines - 1 && ((_lineProperties[right.y()] & LINE_WRAPPED) != 0)))

Loading…
Cancel
Save