Commit 25e2a9f6 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Remove level of indentation

We can always return on the if, and remove the else.
parent b3591918
......@@ -1637,40 +1637,40 @@ void Screen::setSelectionEnd(const int x, const int y, const bool trimTrailingWh
_selTopLeft = loc(qMin(topColumn, bottomColumn), topRow);
_selBottomRight = loc(qMax(topColumn, bottomColumn), bottomRow);
} else {
// Extend the selection to the rightmost column if beyond the last character in the line
const int bottomRow = _selBottomRight / _columns;
const int bottomColumn = _selBottomRight % _columns;
return;
}
// Extend the selection to the rightmost column if beyond the last character in the line
const int bottomRow = _selBottomRight / _columns;
const int bottomColumn = _selBottomRight % _columns;
bool beyondLastColumn = true;
if (bottomRow < _history->getLines()) {
ImageLine histLine;
const int histLineLen = _history->getLineLen(bottomRow);
histLine.resize(histLineLen);
bool beyondLastColumn = true;
if (bottomRow < _history->getLines()) {
ImageLine histLine;
const int histLineLen = _history->getLineLen(bottomRow);
histLine.resize(histLineLen);
_history->getCells(bottomRow, 0, histLineLen, histLine.data());
_history->getCells(bottomRow, 0, histLineLen, histLine.data());
for (int j = bottomColumn; j < histLineLen; j++) {
if ((histLine.at(j).flags & EF_REAL) != 0 && (!trimTrailingWhitespace || !QChar(histLine.at(j).character).isSpace())) {
beyondLastColumn = false;
}
for (int j = bottomColumn; j < histLineLen; j++) {
if ((histLine.at(j).flags & EF_REAL) != 0 && (!trimTrailingWhitespace || !QChar(histLine.at(j).character).isSpace())) {
beyondLastColumn = false;
}
} else {
const size_t line = bottomRow - _history->getLines();
const int lastColumn = (line < _lineProperties.size() && _lineProperties[line] & LINE_DOUBLEWIDTH) ? _columns / 2 : _columns;
const auto *data = _screenLines[line].data();
const int length = _screenLines.at(line).count();
for (int k = bottomColumn; k < lastColumn && k < length; k++) {
if ((data[k].flags & EF_REAL) != 0 && (!trimTrailingWhitespace || !QChar(data[k].character).isSpace())) {
beyondLastColumn = false;
}
}
} else {
const size_t line = bottomRow - _history->getLines();
const int lastColumn = (line < _lineProperties.size() && _lineProperties[line] & LINE_DOUBLEWIDTH) ? _columns / 2 : _columns;
const auto *data = _screenLines[line].data();
const int length = _screenLines.at(line).count();
for (int k = bottomColumn; k < lastColumn && k < length; k++) {
if ((data[k].flags & EF_REAL) != 0 && (!trimTrailingWhitespace || !QChar(data[k].character).isSpace())) {
beyondLastColumn = false;
}
}
}
if (beyondLastColumn) {
_selBottomRight = loc(_columns - 1, bottomRow);
}
if (beyondLastColumn) {
_selBottomRight = loc(_columns - 1, bottomRow);
}
}
......
Supports Markdown
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