diff --git a/src/apps/terminal/HistoryBuffer.cpp b/src/apps/terminal/HistoryBuffer.cpp index 7fe7d096f3..98e1cb7603 100644 --- a/src/apps/terminal/HistoryBuffer.cpp +++ b/src/apps/terminal/HistoryBuffer.cpp @@ -90,7 +90,8 @@ HistoryBuffer::GetTerminalLineAt(int32 index, TerminalLine* buffer) const if (charCount == nextAttributesAt) { if (attributesRunCount > 0) { attributes = attributesRun->attributes; - nextAttributesAt = attributesRun->offset + attributesRun->length; + nextAttributesAt = attributesRun->offset + + attributesRun->length; attributesRun++; attributesRunCount--; } else { @@ -180,6 +181,10 @@ HistoryBuffer::AddLine(const TerminalLine* line) i++; } + // set the last attributes run's length + if (attributes != 0) + attributesRun->length = line->length - attributesRun->offset; + historyLine->softBreak = line->softBreak; //debug_printf(" line: \"%.*s\", history size now: %ld\n", historyLine->byteLength, historyLine->Chars(), fSize); }