Fix remembering selection in scrollback buffer

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.
wilder
Luis Javier Merino Morán 4 years ago committed by Kurt Hindenburg
parent 13031aa37c
commit 7a1e47686a
  1. 6
      src/Screen.cpp

@ -1693,10 +1693,10 @@ void Screen::addHistLine()
bool beginIsTL = (_selBegin == _selTopLeft);
// Adjust selection for the new point of reference
if (newHistLines > oldHistLines) {
if (newHistLines != oldHistLines) {
if (_selBegin != -1) {
_selTopLeft += _columns;
_selBottomRight += _columns;
_selTopLeft += _columns * (newHistLines - oldHistLines);
_selBottomRight += _columns * (newHistLines - oldHistLines);
}
}

Loading…
Cancel
Save