Commit 347bef6c authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Fix trimmed selections in scrollback buffer

Commits 4e69f47b and 9046680f where using an incorrect start of buffer
when trimming trailing spaces and trailing empty cells in a line from
the scrollback buffer.  This could cause too short of a text to be
copied from the selection when there were trailing spaces in the
selection.

BUG: 461542
CCBUG: 455165
(cherry picked from commit f01fdd0a)
parent 0e3868d7
Pipeline #265787 skipped
......@@ -2083,7 +2083,7 @@ int Screen::copyLineToStream(int line,
// Exclude trailing empty cells from count and don't bother processing them further.
// See the comment on the similar case for screen lines for an explanation.
while (count > 0 && (characterBuffer[start + count - 1].flags & EF_REAL) == 0) {
while (count > 0 && (characterBuffer[count - 1].flags & EF_REAL) == 0) {
count--;
}
......@@ -2092,7 +2092,7 @@ int Screen::copyLineToStream(int line,
} else {
if (options.testFlag(TrimTrailingWhitespace)) {
// ignore trailing white space at the end of the line
while (count > 0 && QChar(characterBuffer[start + count - 1].character).isSpace()) {
while (count > 0 && QChar(characterBuffer[count - 1].character).isSpace()) {
count--;
}
}
......
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