Skip to content
  • Luis Javier Merino's avatar
    Fix appending characters at end of line in double width lines · 9ffe33a2
    Luis Javier Merino authored and Kurt Hindenburg's avatar Kurt Hindenburg committed
    Since double-width/double-height lines have room for just half the
    characters, take that into account.
    
    Can be tested with:
    
    perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7h$r";
             $s="L"."X"x38 ."RL"; say "\e#6$s"'
    
    The above tests that appending characters to double-width lines in
    DECAWM (Auto Wrap Mode) wraps at the correct last column. There should
    appear a second line (single-width) with a single "L".
    
    perl -E '$r=join "", map{$_%10}1..80; say "\e<\e[?40h\e[?3l\e[?7l$r";
             $s="L"."X"x42 ." TEST FAILED OUTOFBOUNDS R"; say "\e#6$s"'
    
    The above tests that appending characters to double-width lines in
    non-DECAWM (Auto Wrap Mode) doesn't write past the last column (visible
    on repaints - switch to another window and back). The last column (below
    columns 79 and 80 of prev line) should have an "R".
    9ffe33a2