Commit d2ca202a 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

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
parent 200d7452
Pipeline #180319 passed with stage
in 2 minutes and 44 seconds
......@@ -1762,11 +1762,13 @@ void Screen::addHistLine()
// If the history is full, increment the count
// of dropped _lines
if (_escapeSequenceUrlExtractor && newHistLines == oldHistLines) {
if (newHistLines <= oldHistLines) {
_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.
if (_escapeSequenceUrlExtractor) {
_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