commands.cc
/*
** scroll_down_full_window - try to scroll listing down one full window,
**                           with one line of overlap.  This routine is
**                           only called when we KNOW that there is at
**                           least one line "above" the current listing.
**                           Only change the current line if it flows off
**                           the "bottom" of the screen.  This routine is
**                           only called when we know that the head\(\) of the
**                           listing isn\'t currently displayed.
*/
try to scroll listing down one full window,
with one line of overlap.  This routine is
only called when we KNOW that there is at
least one line "above" the current listing.
Only change the current line if it flows off
the "bottom" of the screen.  This routine is
only called when we know that the head\(\) of the
listing isn\'t currently displayed.
try to scroll listing down one full window with one line of overlap . This routine is only called when we KNOW that there is at least one line " above " the current listing . Only change the current line if it flows off the " bottom " of the screen . This routine is only called when we know that the head \ ( \ ) of the listing isn \ ' t currently displayed .
static void scroll_down_full_window(DirList *dl)
{
    DirLine *ln = dl->firstLine();
    for (int y = 0; y < rows() - 3 && ln != dl->head(); y++, ln = ln->prev());
     y == # of lines preceding firstLine\(\) to add to screen
    dl->setFirst(ln);
    cursor_home();
    for (int j = 0; j < rows()-2 && ln; j++, ln = ln->next())
    {
        clear_to_end_of_line();
        display_string(ln->line(), ln->length());
    }
    move_cursor(j, 0);
    for (; j < rows() - 2; j++)
    {
        clear_to_end_of_line();
        cursor_down();
    }
    if (ln) dl->setLast(ln->prev());
    if (dl->savedYPos()+y >= rows()-2)
    {
        dl->setCurrLine(dl->lastLine());
        dl->saveYXPos(rows()-3, goal_column(dl));
    }
    else
        dl->saveYXPos(dl->savedYPos()+y, dl->savedXPos());
    if (dl->currLine()->length() > columns())
        leftshift_current_line(dl);
    else
        move_cursor(dl->savedYPos(), dl->savedXPos());
    synch_display();
}
static void scroll_down_full_window ( DirList * dl ) { DirLine * ln = dl -> firstLine ( ) ; for ( int y = 0 ; y < rows ( ) - 3 && ln != dl -> head ( ) ; y ++ , ln = ln -> prev ( ) ) ; dl -> setFirst ( ln ) ; cursor_home ( ) ; for ( int j = 0 ; j < rows ( ) - 2 && ln ; j ++ , ln = ln -> next ( ) ) { clear_to_end_of_line ( ) ; display_string ( ln -> line ( ) , ln -> length ( ) ) ; } move_cursor ( j , 0 ) ; for ( ; j < rows ( ) - 2 ; j ++ ) { clear_to_end_of_line ( ) ; cursor_down ( ) ; } if ( ln ) dl -> setLast ( ln -> prev ( ) ) ; if ( dl -> savedYPos ( ) + y >= rows ( ) - 2 ) { dl -> setCurrLine ( dl -> lastLine ( ) ) ; dl -> saveYXPos ( rows ( ) - 3 , goal_column ( dl ) ) ; } else dl -> saveYXPos ( dl -> savedYPos ( ) + y , dl -> savedXPos ( ) ) ; if ( dl -> currLine ( ) -> length ( ) > columns ( ) ) leftshift_current_line ( dl ) ; else move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; }
scroll_down_full_window - try to scroll listing down one full window,
with one line of overlap.
scroll_down_full_window - try to scroll listing down one full window with one line of overlap .
// // y == # of lines preceding firstLine\(\) to add to screen //