Commit 2ec02d1a authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Tomaz Canabrava

don't extend position from a random place

parent 834d560e
......@@ -147,9 +147,9 @@ void TerminalDisplay::setScreenWindow(ScreenWindow* window)
_filterUpdateRequired = true;
});
connect(_screenWindow.data(), &Konsole::ScreenWindow::screenAboutToChange, this, [this]() {
_iPntSel = QPoint();
_pntSel = QPoint();
_tripleSelBegin = QPoint();
_iPntSel = QPoint(-1, -1);
_pntSel = QPoint(-1, -1);
_tripleSelBegin = QPoint(-1, -1);
});
connect(_screenWindow.data(), &Konsole::ScreenWindow::scrolled, this, [this]() {
_filterUpdateRequired = true;
......@@ -467,9 +467,9 @@ TerminalDisplay::TerminalDisplay(QWidget* parent)
, _usesMouseTracking(false)
, _alternateScrolling(true)
, _bracketedPasteMode(false)
, _iPntSel(QPoint())
, _pntSel(QPoint())
, _tripleSelBegin(QPoint())
, _iPntSel(QPoint(-1, -1))
, _pntSel(QPoint(-1, -1))
, _tripleSelBegin(QPoint(-1, -1))
, _actSel(0)
, _wordSelectionMode(false)
, _lineSelectionMode(false)
......@@ -2308,6 +2308,11 @@ void TerminalDisplay::extendSelection(const QPoint& position)
return;
}
if (_iPntSel.x() < 0 || _iPntSel.y() < 0 || _pntSel.x() < 0 || _pntSel.y() < 0) {
_iPntSel = _pntSel = position;
return;
}
//if ( !contentsRect().contains(ev->pos()) ) return;
const QPoint tL = contentsRect().topLeft();
const int tLx = tL.x();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment