… | |
… | |
883 | |
883 | |
884 | stp = screen.text[row]; /* _must_ refresh */ |
884 | stp = screen.text[row]; /* _must_ refresh */ |
885 | srp = screen.rend[row]; /* _must_ refresh */ |
885 | srp = screen.rend[row]; /* _must_ refresh */ |
886 | } |
886 | } |
887 | |
887 | |
888 | if (screen.flags & Screen_Insert) |
|
|
889 | scr_insdel_chars (1, INSERT); |
|
|
890 | |
|
|
891 | // rely on wcwidth to tell us the character width, at least for non-latin1 |
888 | // rely on wcwidth to tell us the character width, at least for non-latin1 |
892 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
889 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
893 | // characters have width -1 (DOH!) on GNU/Linux sometimes. |
890 | // characters have width -1 (DOH!) on GNU/Linux sometimes. |
894 | int width = c < 0x100 ? 1 : wcwidth (c); |
891 | int width = c < 0x100 ? 1 : wcwidth (c); |
895 | |
892 | |
896 | if (charsets[screen.charset] == '0') // DEC SPECIAL |
893 | if (charsets[screen.charset] == '0') // DEC SPECIAL |
897 | { |
894 | { |
898 | // vt100 special graphics and line drawing |
895 | // vt100 special graphics and line drawing |
899 | // 5f-7e standard vt100 |
896 | // 5f-7e standard vt100 |
900 | // 40-5e rxvt extension for extra curses acs chars |
897 | // 40-5e rxvt extension for extra curses acs chars |
901 | static uint16_t vt100_0[63] = { // 5f .. 7e |
898 | static uint16_t vt100_0[63] = { // 40 .. 7e |
902 | 0x0000, 0x2191, 0x2193, 0x2192, 0x2190, 0x2588, 0x259a, 0x2603, // 40-47 hi mr. snowman! |
899 | 0x0000, 0x2191, 0x2193, 0x2192, 0x2190, 0x2588, 0x259a, 0x2603, // 40-47 hi mr. snowman! |
903 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 48-4f |
900 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 48-4f |
904 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 50-57 |
901 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 50-57 |
905 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, // 58-5f |
902 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, // 58-5f |
906 | 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, // 60-67 |
903 | 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, // 60-67 |
… | |
… | |
913 | { |
910 | { |
914 | c = vt100_0[c - 0x40]; |
911 | c = vt100_0[c - 0x40]; |
915 | width = 1; |
912 | width = 1; |
916 | } |
913 | } |
917 | } |
914 | } |
|
|
915 | |
|
|
916 | if (screen.flags & Screen_Insert) |
|
|
917 | scr_insdel_chars (width, INSERT); |
918 | |
918 | |
919 | if (width != 0) |
919 | if (width != 0) |
920 | { |
920 | { |
921 | // some utf-8 decoders decode surrogate characters. |
921 | // some utf-8 decoders decode surrogate characters. |
922 | if (0xd800 <= c && c <= 0xdfff) |
922 | if (0xd800 <= c && c <= 0xdfff) |
… | |
… | |
1100 | if (count) |
1100 | if (count) |
1101 | x = TermWin.ncol - 1; |
1101 | x = TermWin.ncol - 1; |
1102 | |
1102 | |
1103 | // store horizontal tab commands as characters inside the text |
1103 | // store horizontal tab commands as characters inside the text |
1104 | // buffer so they can be selected and pasted. |
1104 | // buffer so they can be selected and pasted. |
1105 | if (ht) |
1105 | if (ht && options & Opt_pastableTabs) |
1106 | { |
1106 | { |
1107 | base_rend = SET_FONT (base_rend, 0); |
1107 | base_rend = SET_FONT (base_rend, 0); |
1108 | |
1108 | |
1109 | if (screen.tlen[row] != -1) /* XXX: think about this */ |
1109 | if (screen.tlen[row] != -1) /* XXX: think about this */ |
1110 | MAX_IT (screen.tlen[row], x); |
1110 | MAX_IT (screen.tlen[row], x); |
… | |
… | |
2244 | && GET_BGATTR (srp[col]) == GET_BGATTR (drp[col])))) |
2244 | && GET_BGATTR (srp[col]) == GET_BGATTR (drp[col])))) |
2245 | continue; |
2245 | continue; |
2246 | |
2246 | |
2247 | // redraw one or more characters |
2247 | // redraw one or more characters |
2248 | |
2248 | |
2249 | // seek to the beginning if wide characters |
2249 | // seek to the beginning of wide characters |
2250 | while (stp[col] == NOCHAR && col > 0) |
2250 | while (stp[col] == NOCHAR && col > 0) |
2251 | --col; |
2251 | --col; |
2252 | |
2252 | |
2253 | rend_t rend = srp[col]; /* screen rendition (target rendtion) */ |
2253 | rend_t rend = srp[col]; /* screen rendition (target rendtion) */ |
2254 | text_t *text = stp + col; |
2254 | text_t *text = stp + col; |