If it extended to the end of the line the length of the last attributes

run of a history line would not be initialized correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25968 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-06-15 21:52:51 +00:00
parent 53779f07a4
commit 535841fcb5
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}