Commit a6fce70f authored by Luis Javier Merino's avatar Luis Javier Merino
Browse files

Fix scroll position jumps regression

Commit d37d3ac1 "CompactHistoryScroll: Remove _maxLineCount + 5 lines at
a time" caused a regression: addHistLine queried the number of lines in
history before and after adding a line, and if it had not incremented it
assumed one line entered history and another was dropped at the other
end.  Now, lines are dropped from history in batches, so take care of
that.

Very similar to the regression fixed at 7a1e4768, only this one is about
keeping the scroll position on the presence of scroll, and that other
one is about keeping the selection.

Thanks to the bug reporters Michael and Luke-Jr for the heads-up.

BUG: 452955
BUG: 453112
(cherry picked from commit d2ca202a)
parent 685326dc
Pipeline #184325 passed with stage
in 3 minutes and 1 second
...@@ -1735,11 +1735,11 @@ void Screen::addHistLine() ...@@ -1735,11 +1735,11 @@ void Screen::addHistLine()
// If the history is full, increment the count // If the history is full, increment the count
// of dropped _lines // of dropped _lines
if (newHistLines == oldHistLines) { if (newHistLines <= oldHistLines) {
++_droppedLines; _droppedLines += oldHistLines - newHistLines + 1;
// We removed a line, we need to verify if we need to remove a URL. // We removed some lines, we need to verify if we need to remove a URL.
_escapeSequenceUrlExtractor->historyLinesRemoved(1); _escapeSequenceUrlExtractor->historyLinesRemoved(oldHistLines - newHistLines + 1);
} }
} }
......
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