write_pos -= write_pos % Term->TextWidth;
break;
- case '\t': { int tmp = write_pos / Term->TextWidth;
+ case '\t': {
+ int line = write_pos / Term->TextWidth;
write_pos %= Term->TextWidth;
do {
buffer[ write_pos ].Ch = '\0';
buffer[ write_pos ].Colour = Term->CurColour;
write_pos ++;
} while(write_pos & 7);
- write_pos += tmp * Term->TextWidth;
+ write_pos += line * Term->TextWidth;
break; }
case '\b':
if(write_pos == 0) break;
write_pos --;
- // Singe Character
+ // Single Character
if(buffer[ write_pos ].Ch != '\0') {
buffer[ write_pos ].Ch = 0;
buffer[ write_pos ].Colour = Term->CurColour;
if(Term->Flags & VT_FLAG_ALTBUF)
{
- Term->AltBuf = buffer;
Term->AltWritePos = write_pos;
if(Term->AltWritePos >= Term->TextWidth*Term->TextHeight)
}
else
{
- Term->Text = buffer;
Term->WritePos = write_pos;
// Move Screen
// - Check if we need to scroll the entire scrollback buffer
{
int base;
- // Update previous line
- Term->WritePos -= Term->TextWidth;
- VT_int_UpdateScreen( Term, 0 );
-
// Update view position
base = Term->TextWidth*Term->TextHeight*(giVT_Scrollback);
if(Term->ViewPos < base)
Term->ViewPos = base;
VT_int_ScrollText(Term, 1);
+ Term->WritePos -= Term->TextWidth;
}
// Ok, so we only need to scroll the screen
else if(Term->WritePos >= Term->ViewPos + Term->TextWidth*Term->TextHeight)
{
- // Update the last line
- Term->WritePos -= Term->TextWidth;
- VT_int_UpdateScreen( Term, 0 );
- Term->WritePos += Term->TextWidth;
-
- VT_int_ScrollText(Term, 1);
+ VT_int_ScrollFramebuffer( Term, 1 );
Term->ViewPos += Term->TextWidth;
}
scroll_height = height;
}
- // Scroll text downwards
+ // Scroll text upwards (more space at bottom)
if( Count > 0 )
{
int base;
// 0 1 2 3 4 5 6 7 8 9 A B C D E F\r
/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0-F\r
/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KEYSYM_K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