commands.cc
/*
** goto_last - position cursor on last file in listing.  This routine is
**             not called if atEndOfList\(\) is true.
*/
position cursor on last file in listing.  This routine is
not called if atEndOfList\(\) is true.
position cursor on last file in listing . This routine is not called if atEndOfList \ ( \ ) is true .
static void goto_last(DirList *dl)
{
    if (dl->currLine()->length() > columns()) rightshift_current_line(dl);
    dl->setCurrLine(dl->tail());
    if (dl->tail() == dl->lastLine())
    {
        dl->saveYXPos(lines_displayed(dl) - 1, goal_column(dl));
        if (dl->currLine()->length() > columns())
            leftshift_current_line(dl);
        else
            move_cursor(dl->savedYPos(), dl->savedXPos());
    }
    else
    {
        DirLine *ln = dl->tail();
        dl->setLast(ln);
        for (int i = 0; i < rows() - 2; i++, ln = ln->prev())
        {
            move_cursor(rows() - 3 - i, 0);
            clear_to_end_of_line();
            display_string(ln->line(), ln->length());
        }
        dl->setFirst(ln->next());
        dl->saveYXPos(rows() - 3,goal_column(dl));
        if (dl->currLine()->length() > columns())
            leftshift_current_line(dl);
        else
            move_cursor(rows() -3 , dl->savedXPos());
    }
    synch_display();
}
static void goto_last ( DirList * dl ) { if ( dl -> currLine ( ) -> length ( ) > columns ( ) ) rightshift_current_line ( dl ) ; dl -> setCurrLine ( dl -> tail ( ) ) ; if ( dl -> tail ( ) == dl -> lastLine ( ) ) { dl -> saveYXPos ( lines_displayed ( dl ) - 1 , goal_column ( dl ) ) ; if ( dl -> currLine ( ) -> length ( ) > columns ( ) ) leftshift_current_line ( dl ) ; else move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; } else { DirLine * ln = dl -> tail ( ) ; dl -> setLast ( ln ) ; for ( int i = 0 ; i < rows ( ) - 2 ; i ++ , ln = ln -> prev ( ) ) { move_cursor ( rows ( ) - 3 - i , 0 ) ; clear_to_end_of_line ( ) ; display_string ( ln -> line ( ) , ln -> length ( ) ) ; } dl -> setFirst ( ln -> next ( ) ) ; dl -> saveYXPos ( rows ( ) - 3 , goal_column ( dl ) ) ; if ( dl -> currLine ( ) -> length ( ) > columns ( ) ) leftshift_current_line ( dl ) ; else move_cursor ( rows ( ) - 3 , dl -> savedXPos ( ) ) ; } synch_display ( ) ; }
goto_last - position cursor on last file in listing.
goto_last - position cursor on last file in listing .
// only need to reposition the cursor // redisplay end of listing & update our view