Fixed scrolling bug in VTerm
authorJohn Hodge <[email protected]>
Sun, 31 Oct 2010 12:29:36 +0000 (20:29 +0800)
committerJohn Hodge <[email protected]>
Sun, 31 Oct 2010 12:30:40 +0000 (20:30 +0800)
- VT_int_ClearLine was rejecting valid line numbers

Kernel/drv/vterm.c

index 5ba3408..720e76b 100644 (file)
@@ -843,7 +843,7 @@ void VT_int_ClearLine(tVTerm *Term, int Num)
 {
         int    i;
        tVT_Char        *cell = &Term->Text[ Num*Term->TextWidth ];
-       if( Num < 0 || Num >= Term->TextHeight )        return ;
+       if( Num < 0 || Num >= Term->TextHeight * (giVT_Scrollback + 1) )        return ;
        //ENTER("pTerm iNum", Term, Num);
        for( i = Term->TextWidth; i--; )
        {
@@ -1073,8 +1073,6 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch)
        {
                 int    base, i;
                
-               //Debug("Scrolling entire buffer");
-               
                // Move back by one
                Term->WritePos -= Term->TextWidth;
                // Update the scren
@@ -1118,6 +1116,7 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch)
                Term->WritePos -= Term->TextWidth;
                VT_int_UpdateScreen( Term, 0 );
                Term->WritePos += Term->TextWidth;
+               VT_int_ClearLine(Term, Term->WritePos / Term->TextWidth);
                
                // Scroll
                Term->ViewPos += Term->TextWidth;

UCC git Repository :: git.ucc.asn.au