Fix copying one single char

Regression introduced by 5919c1fd.  The selection range is inclusive in
both ends.

Thanks to Chiitoo for reporting and to Yerrey Dev for proposing a
solution.

BUG: 448144
wilder
Luis Javier Merino Morán 4 years ago committed by Kurt Hindenburg
parent 2b2dbdfd4e
commit 830f416850
  1. 2
      src/Emulation.cpp
  2. 9
      src/Screen.cpp
  3. 1
      src/Screen.h

@ -92,7 +92,7 @@ void Emulation::checkScreenInUse()
void Emulation::checkSelectedText()
{
bool isEmpty = _currentScreen->isSelectionEmpty();
bool isEmpty = !_currentScreen->hasSelection();
Q_EMIT selectionChanged(isEmpty);
}

@ -1425,15 +1425,6 @@ bool Screen::isSelected(const int x, const int y) const
return pos >= _selTopLeft && pos <= _selBottomRight && columnInSelection;
}
bool Screen::isSelectionEmpty() const
{
if (!isSelectionValid()) {
return true;
}
return _selTopLeft == _selBottomRight;
}
QString Screen::selectedText(const DecodingOptions options) const
{
if (!isSelectionValid()) {

@ -467,7 +467,6 @@ public:
*/
bool isSelected(const int x, const int y) const;
bool isSelectionEmpty() const;
/**
* Convenience method. Returns the currently selected text.
* @param options See Screen::DecodingOptions

Loading…
Cancel
Save