Changeset 16880 for trunk/FACT++/src


Ignore:
Timestamp:
06/21/13 16:02:59 (11 years ago)
Author:
tbretz
Message:
Redisplay has to check if this is an update due to change of terminal size. If this is the case the cursor must be moved back to the beginning of the line. For convenience we also clean the line (to remove the last charcter in the line, which (maybe fpor safty reason to avoid newlines) readline doesn't remove.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Readline.cc

    r16869 r16880  
    349349//! Default: call rl_redisplay()
    350350//
     351
    351352void Readline::Redisplay()
    352353{
     354    static int W=-1, H=-1;
     355
     356    int w, h;
     357    rl_get_screen_size(&h, &w);
     358    if (W!=w || h!=H)
     359    {
     360        cout << '\r' << string(w+1, ' ') << '\r';
     361
     362        W=w;
     363        H=h;
     364    }
     365
    353366    rl_redisplay();
    354367}
Note: See TracChangeset for help on using the changeset viewer.