… | |
… | |
144 | col--; |
144 | col--; |
145 | |
145 | |
146 | rend_t rend = l.r[col] & ~RS_baseattrMask; |
146 | rend_t rend = l.r[col] & ~RS_baseattrMask; |
147 | rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); |
147 | rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); |
148 | |
148 | |
|
|
149 | l.touch (); |
|
|
150 | |
149 | // found start, nuke |
151 | // found start, nuke |
150 | do { |
152 | do { |
151 | l.t[col] = ' '; |
153 | l.t[col] = ' '; |
152 | l.r[col] = rend; |
154 | l.r[col] = rend; |
153 | col++; |
155 | col++; |
… | |
… | |
915 | else |
917 | else |
916 | screen.cur.col = ncol - width; |
918 | screen.cur.col = ncol - width; |
917 | } |
919 | } |
918 | |
920 | |
919 | // nuke the character at this position, if required |
921 | // nuke the character at this position, if required |
920 | if (expect_false ( |
922 | // due to wonderful coincidents everywehere else in this loop |
|
|
923 | // we never have to check for overwriting a wide char itself, |
|
|
924 | // only it's tail. |
921 | line->t[screen.cur.col] == NOCHAR |
925 | if (expect_false (line->t[screen.cur.col] == NOCHAR)) |
922 | || (screen.cur.col < ncol - 1 |
|
|
923 | && line->t[screen.cur.col + 1] == NOCHAR) |
|
|
924 | )) |
|
|
925 | scr_kill_char (*line, screen.cur.col); |
926 | scr_kill_char (*line, screen.cur.col); |
926 | |
927 | |
927 | line->touch (); |
928 | line->touch (); |
928 | |
929 | |
929 | do |
930 | do |
… | |
… | |
936 | else |
937 | else |
937 | { |
938 | { |
938 | line->l = ncol; |
939 | line->l = ncol; |
939 | if (screen.flags & Screen_Autowrap) |
940 | if (screen.flags & Screen_Autowrap) |
940 | screen.flags |= Screen_WrapNext; |
941 | screen.flags |= Screen_WrapNext; |
941 | break; |
942 | |
|
|
943 | goto end_of_line; |
942 | } |
944 | } |
943 | |
945 | |
944 | c = NOCHAR; |
946 | c = NOCHAR; |
945 | } |
947 | } |
946 | while (expect_false (--width > 0)); |
948 | while (expect_false (--width > 0)); |
947 | |
949 | |
948 | // pad with spaces when overwriting wide character with smaller one |
950 | // pad with spaces when overwriting wide character with smaller one |
949 | if (expect_false (!width)) |
951 | for (int c = screen.cur.col; expect_false (c < ncol && line->t[c] == NOCHAR); c++) |
950 | { |
952 | { |
951 | line->touch (); |
|
|
952 | |
|
|
953 | for (int c = screen.cur.col; c < ncol && line->t[c] == NOCHAR; c++) |
|
|
954 | { |
|
|
955 | line->t[c] = ' '; |
953 | line->t[c] = ' '; |
956 | line->r[c] = rend; |
954 | line->r[c] = rend; |
957 | } |
|
|
958 | } |
955 | } |
|
|
956 | |
|
|
957 | end_of_line: |
|
|
958 | ; |
959 | } |
959 | } |
960 | #if ENABLE_COMBINING |
960 | #if ENABLE_COMBINING |
961 | else // width == 0 |
961 | else // width == 0 |
962 | { |
962 | { |
963 | if (c != 0xfeff) // ignore BOM |
963 | if (c != 0xfeff) // ignore BOM |