* Fixed \ESC[0J (erase screen below). It shall not erase any character
on the line before the cursor. * Implemented \ESC[1J (erase screen above. * Fixed \ESC[2J (erase all). It shall not move the cursor. * When scrolling only the top part of the screen, we do now also invalidate the line below the scroll region. Otherwise the view wouldn't know that they have not been scrolled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25986 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
dfa76786b3
commit
5d2d3a845c
@ -628,10 +628,39 @@ BasicTerminalBuffer::InsertSpace(int32 num)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BasicTerminalBuffer::EraseAbove()
|
||||
{
|
||||
// Clear the preceding lines.
|
||||
if (fCursor.y > 0)
|
||||
_ClearLines(0, fCursor.y - 1);
|
||||
|
||||
// Delete the chars on the cursor line before (and including) the cursor.
|
||||
TerminalLine* line = _LineAt(fCursor.y);
|
||||
if (fCursor.x < line->length) {
|
||||
int32 to = fCursor.x;
|
||||
if (IS_WIDTH(line->cells[fCursor.x].attributes))
|
||||
to++;
|
||||
for (int32 i = 0; i <= to; i++) {
|
||||
line->cells[i].attributes = 0;
|
||||
line->cells[i].character = kSpaceChar;
|
||||
}
|
||||
} else
|
||||
line->Clear();
|
||||
|
||||
_Invalidate(fCursor.y, fCursor.y);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BasicTerminalBuffer::EraseBelow()
|
||||
{
|
||||
_Scroll(fCursor.y, fHeight - 1, fHeight);
|
||||
// Clear the following lines.
|
||||
if (fCursor.y < fHeight - 1)
|
||||
_ClearLines(fCursor.y + 1, fHeight - 1);
|
||||
|
||||
// Delete the chars on the cursor line after (and including) the cursor.
|
||||
DeleteColumns();
|
||||
}
|
||||
|
||||
|
||||
@ -1146,6 +1175,14 @@ BasicTerminalBuffer::_Scroll(int32 top, int32 bottom, int32 numLines)
|
||||
|
||||
// invalidate new empty lines
|
||||
_Invalidate(bottom + 1 - numLines, bottom);
|
||||
|
||||
// In case only part of the screen was scrolled, we invalidate also
|
||||
// the lines below the scroll region. Those remain unchanged, but
|
||||
// we can't convey that they have not been scrolled via
|
||||
// TerminalBufferDirtyInfo. So we need to force the view to sync
|
||||
// them again.
|
||||
if (bottom < fHeight - 1)
|
||||
_Invalidate(bottom + 1, fHeight - 1);
|
||||
} else if (numLines >= bottom - top + 1) {
|
||||
// all lines are completely scrolled out of range -- just clear
|
||||
// them
|
||||
|
@ -104,6 +104,7 @@ public:
|
||||
void InsertLines(int32 numLines);
|
||||
|
||||
// delete chars/lines
|
||||
void EraseAbove();
|
||||
void EraseBelow();
|
||||
void DeleteChars(int32 numChars);
|
||||
void DeleteColumns();
|
||||
|
@ -630,11 +630,12 @@ TermParse::EscParse()
|
||||
break;
|
||||
|
||||
case 1:
|
||||
fBuffer->EraseAbove();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
fBuffer->SetCursor(0, 0);
|
||||
fBuffer->EraseBelow();
|
||||
fBuffer->EraseAbove();
|
||||
break;
|
||||
}
|
||||
parsestate = groundtable;
|
||||
|
Loading…
Reference in New Issue
Block a user