… | |
… | |
888 | // 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 |
889 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
889 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
890 | // characters have width -1 (DOH!) on GNU/Linux sometimes. |
890 | // characters have width -1 (DOH!) on GNU/Linux sometimes. |
891 | int width = c < 0x100 ? 1 : wcwidth (c); |
891 | int width = c < 0x100 ? 1 : wcwidth (c); |
892 | |
892 | |
893 | if (screen.flags & Screen_Insert) |
|
|
894 | scr_insdel_chars (width, INSERT); |
|
|
895 | |
|
|
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) |