commands.cc
/*
** update_current_line - updates the current line in the listing
**                       and it\'s representation on the screen.
*/
updates the current line in the listing
and it\'s representation on the screen.
updates the current line in the listing and it \ ' s representation on the screen .
static void update_current_line(DirList *dl, char *new_line)
{
    if (strlen(new_line) <= columns() && dl->currLine()->length() <= columns())
    {
         The most common case.
        update_screen_line(dl->currLine()->line(), new_line, dl->savedYPos());
        dl->currLine()->update(&new_line);
        dl->saveYXPos(dl->savedYPos(), goal_column(dl));
        move_cursor(dl->savedYPos(), dl->savedXPos());
    }
    else
    {
         Either the old or the new line must be shifted.
         Probably not worth trying to use update_screen_line\(\).
        dl->currLine()->update(&new_line);
        dl->saveYXPos(dl->savedYPos(), goal_column(dl));
        if (dl->currLine()->length() > columns())
            leftshift_current_line(dl);
        else
        {
            move_cursor(dl->savedYPos(), 0);
            clear_to_end_of_line();
            display_string(new_line);
            move_cursor(dl->savedYPos(), dl->savedXPos());
        }
    }
}
static void update_current_line ( DirList * dl , char * new_line ) { if ( strlen ( new_line ) <= columns ( ) && dl -> currLine ( ) -> length ( ) <= columns ( ) ) { update_screen_line ( dl -> currLine ( ) -> line ( ) , new_line , dl -> savedYPos ( ) ) ; dl -> currLine ( ) -> update ( & new_line ) ; dl -> saveYXPos ( dl -> savedYPos ( ) , goal_column ( dl ) ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; } else { dl -> currLine ( ) -> update ( & new_line ) ; dl -> saveYXPos ( dl -> savedYPos ( ) , goal_column ( dl ) ) ; if ( dl -> currLine ( ) -> length ( ) > columns ( ) ) leftshift_current_line ( dl ) ; else { move_cursor ( dl -> savedYPos ( ) , 0 ) ; clear_to_end_of_line ( ) ; display_string ( new_line ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; } } }
update_current_line - updates the current line in the listing
and it\'s representation on the screen.
update_current_line - updates the current line in the listing and it \ ' s representation on the screen .
// // The most common case. // // // Either the old or the new line must be shifted. // Probably not worth trying to use update_screen_line\(\). //