Dont add one extra line when creating CompactHistoryScroll

Fixes HistoryTest::testHistoryTypeChange.

We were subtracting -1 for no reason. This lead to adding one extra line
to the history. The previous implementation would immediately remove the
top line but the new one waits till we have 5 extra lines. Hence, the
test broke.
wilder
Waqar Ahmed 4 years ago
parent 3403585b87
commit f1224716a1
  1. 2
      src/history/compact/CompactHistoryType.cpp

@ -39,7 +39,7 @@ void CompactHistoryType::scroll(std::unique_ptr<HistoryScroll> &old) const
Character line[LINE_SIZE];
int lines = (old != nullptr) ? old->getLines() : 0;
int i = qMax((lines - (int)_maxLines - 1), 0);
int i = qMax((lines - (int)_maxLines), 0);
for (; i < lines; i++) {
int size = old->getLineLen(i);
if (size > LINE_SIZE) {

Loading…
Cancel
Save