… | |
… | |
864 | } |
864 | } |
865 | |
865 | |
866 | if (screen.flags & Screen_Insert) |
866 | if (screen.flags & Screen_Insert) |
867 | scr_insdel_chars (1, INSERT); |
867 | scr_insdel_chars (1, INSERT); |
868 | |
868 | |
869 | if (IS_COMPOSE (c)) |
|
|
870 | c = REPLACEMENT_CHAR; |
|
|
871 | |
|
|
872 | // rely on wcwidth to tell us the character width, at least for non-latin1 |
869 | // rely on wcwidth to tell us the character width, at least for non-latin1 |
873 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
870 | // do wcwidth before further replacements, as wcwidth says that line-drawing |
874 | // characters have width -1 (DOH!) on gnu/linux sometimes. |
871 | // characters have width -1 (DOH!) on gnu/linux sometimes. |
875 | int width = c < 256 ? 1 : wcwidth (c); |
872 | int width = c < 256 ? 1 : wcwidth (c); |
876 | |
873 | |
… | |
… | |
888 | case 's': c = 0x23bd; break; case 't': c = 0x251c; break; case 'u': c = 0x2524; break; |
885 | case 's': c = 0x23bd; break; case 't': c = 0x251c; break; case 'u': c = 0x2524; break; |
889 | case 'v': c = 0x2534; break; case 'w': c = 0x252c; break; case 'x': c = 0x2502; break; |
886 | case 'v': c = 0x2534; break; case 'w': c = 0x252c; break; case 'x': c = 0x2502; break; |
890 | case 'y': c = 0x2264; break; case 'z': c = 0x2265; break; case '{': c = 0x03c0; break; |
887 | case 'y': c = 0x2264; break; case 'z': c = 0x2265; break; case '{': c = 0x03c0; break; |
891 | case '|': c = 0x2260; break; case '}': c = 0x00a3; break; case '~': c = 0x00b7; break; |
888 | case '|': c = 0x2260; break; case '}': c = 0x00a3; break; case '~': c = 0x00b7; break; |
892 | } |
889 | } |
893 | |
|
|
894 | |
890 | |
895 | if (width > 0) |
891 | if (width > 0) |
896 | { |
892 | { |
897 | #if !UNICODE_3 |
893 | #if !UNICODE_3 && ENABLE_COMBINING |
898 | // trim characters we can't store directly :( |
894 | // trim characters we can't store directly :( |
899 | if (c >= 0x10000) |
895 | if (c >= 0x10000) |
900 | c = rxvt_composite.compose (c); // map to lower 16 bits |
896 | c = rxvt_composite.compose (c); // map to lower 16 bits |
901 | #endif |
897 | #endif |
902 | rend_t rend = SET_FONT (rstyle, TermWin.fontset->find_font (c)); |
898 | rend_t rend = SET_FONT (rstyle, TermWin.fontset->find_font (c)); |
… | |
… | |
927 | srp[c] = rend; |
923 | srp[c] = rend; |
928 | } |
924 | } |
929 | } |
925 | } |
930 | else if (width == 0) |
926 | else if (width == 0) |
931 | { |
927 | { |
932 | #if ENCODING_COMPOSE |
928 | #if ENABLE_COMBINING |
933 | // handle combining characters |
929 | // handle combining characters |
934 | // we just tag the accent on the previous on-screen character. |
930 | // we just tag the accent on the previous on-screen character. |
935 | // this is arguably not correct, but also arguably not wrong. |
931 | // this is arguably not correct, but also arguably not wrong. |
936 | // we don't handle double-width characters nicely yet. |
932 | // we don't handle double-width characters nicely yet. |
937 | |
933 | |
… | |
… | |
2192 | else |
2188 | else |
2193 | rvid = !rvid; |
2189 | rvid = !rvid; |
2194 | } |
2190 | } |
2195 | |
2191 | |
2196 | if (rend & RS_Uline) |
2192 | if (rend & RS_Uline) |
2197 | { |
|
|
2198 | if (ISSET_PIXCOLOR (Color_UL)) |
2193 | if (ISSET_PIXCOLOR (Color_UL)) |
2199 | fore = Color_UL; |
2194 | fore = Color_UL; |
2200 | } |
|
|
2201 | #endif |
2195 | #endif |
2202 | |
2196 | |
2203 | if (rvid) |
2197 | if (rvid) |
2204 | { |
2198 | { |
2205 | SWAP_IT (fore, back, int); |
2199 | SWAP_IT (fore, back, int); |
… | |
… | |
2838 | |
2832 | |
2839 | for (; col < end_col; col++) |
2833 | for (; col < end_col; col++) |
2840 | { |
2834 | { |
2841 | if (*t == NOCHAR) |
2835 | if (*t == NOCHAR) |
2842 | t++; |
2836 | t++; |
|
|
2837 | #if ENABLE_COMBINING |
2843 | else if (IS_COMPOSE (*t)) |
2838 | else if (IS_COMPOSE (*t)) |
2844 | { |
2839 | { |
2845 | int len = rxvt_composite.expand (*t, 0); |
2840 | int len = rxvt_composite.expand (*t, 0); |
2846 | |
2841 | |
2847 | extra -= (len - 1); |
2842 | extra -= (len - 1); |
… | |
… | |
2853 | new_selection_text = (wchar_t *)rxvt_realloc (new_selection_text, (i + 4) * sizeof (wchar_t)); |
2848 | new_selection_text = (wchar_t *)rxvt_realloc (new_selection_text, (i + 4) * sizeof (wchar_t)); |
2854 | } |
2849 | } |
2855 | |
2850 | |
2856 | ofs += rxvt_composite.expand (*t++, new_selection_text + ofs); |
2851 | ofs += rxvt_composite.expand (*t++, new_selection_text + ofs); |
2857 | } |
2852 | } |
|
|
2853 | #endif |
2858 | else |
2854 | else |
2859 | new_selection_text[ofs++] = *t++; |
2855 | new_selection_text[ofs++] = *t++; |
2860 | } |
2856 | } |
2861 | |
2857 | |
2862 | if (screen.tlen[row] != -1 && row != end_row) |
2858 | if (screen.tlen[row] != -1 && row != end_row) |