Commit f1224716 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

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.
parent 3403585b
Pipeline #97925 passed with stage
in 1 minute and 52 seconds
......@@ -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) {
......
Markdown is supported
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