… | |
… | |
1284 | CLEAR_ROWS (row, num); |
1284 | CLEAR_ROWS (row, num); |
1285 | } |
1285 | } |
1286 | else |
1286 | else |
1287 | { |
1287 | { |
1288 | ren = rstyle & (RS_fgMask | RS_bgMask); |
1288 | ren = rstyle & (RS_fgMask | RS_bgMask); |
1289 | gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)]; |
1289 | gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; |
1290 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1290 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1291 | ERASE_ROWS (row, num); |
1291 | ERASE_ROWS (row, num); |
1292 | gcvalue.foreground = pix_colors[Color_fg]; |
1292 | gcvalue.foreground = pix_colors[Color_fg]; |
1293 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1293 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1294 | } |
1294 | } |
… | |
… | |
1988 | cc1 = *crp & (RS_fgMask | RS_bgMask); |
1988 | cc1 = *crp & (RS_fgMask | RS_bgMask); |
1989 | if (ISSET_PIXCOLOR (Color_cursor)) |
1989 | if (ISSET_PIXCOLOR (Color_cursor)) |
1990 | ccol1 = Color_cursor; |
1990 | ccol1 = Color_cursor; |
1991 | else |
1991 | else |
1992 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
1992 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
1993 | ccol1 = GET_FGCOLOR (rstyle); |
1993 | ccol1 = fgcolor_of (rstyle); |
1994 | #else |
1994 | #else |
1995 | ccol1 = Color_fg; |
1995 | ccol1 = Color_fg; |
1996 | #endif |
1996 | #endif |
1997 | if (ISSET_PIXCOLOR (Color_cursor2)) |
1997 | if (ISSET_PIXCOLOR (Color_cursor2)) |
1998 | ccol2 = Color_cursor2; |
1998 | ccol2 = Color_cursor2; |
1999 | else |
1999 | else |
2000 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2000 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2001 | ccol2 = GET_BGCOLOR (rstyle); |
2001 | ccol2 = bgcolor_of (rstyle); |
2002 | #else |
2002 | #else |
2003 | ccol2 = Color_bg; |
2003 | ccol2 = Color_bg; |
2004 | #endif |
2004 | #endif |
2005 | *crp = SET_FGCOLOR (*crp, ccol1); |
2005 | *crp = SET_FGCOLOR (*crp, ccol1); |
2006 | *crp = SET_BGCOLOR (*crp, ccol2); |
2006 | *crp = SET_BGCOLOR (*crp, ccol2); |
… | |
… | |
2187 | count++, i--; |
2187 | count++, i--; |
2188 | |
2188 | |
2189 | /* |
2189 | /* |
2190 | * Determine the attributes for the string |
2190 | * Determine the attributes for the string |
2191 | */ |
2191 | */ |
2192 | int fore = GET_FGCOLOR (rend); // desired foreground |
2192 | int fore = fgcolor_of (rend); // desired foreground |
2193 | int back = GET_BGCOLOR (rend); // desired background |
2193 | int back = bgcolor_of (rend); // desired background |
2194 | |
2194 | |
2195 | // only do special processing if any attributes are set, which is unlikely |
2195 | // only do special processing if any attributes are set, which is unlikely |
2196 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2196 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2197 | { |
2197 | { |
2198 | #if ENABLE_STYLES |
2198 | #if ENABLE_STYLES |
… | |
… | |
2448 | |
2448 | |
2449 | #if ENABLE_FRILLS |
2449 | #if ENABLE_FRILLS |
2450 | if (selection.rect) |
2450 | if (selection.rect) |
2451 | { |
2451 | { |
2452 | for (row = max (selection.beg.row, -view_start); row <= min (selection.end.row, view_end); row++) |
2452 | for (row = max (selection.beg.row, -view_start); row <= min (selection.end.row, view_end); row++) |
|
|
2453 | { |
|
|
2454 | text_t *stp = ROW(row).t; |
|
|
2455 | rend_t *srp = ROW(row).r; |
|
|
2456 | |
2453 | for (rend_t *srp = ROW(row).r, col = selection.beg.col; col < selection.end.col; col++) |
2457 | for (col = selection.beg.col; col < selection.end.col; col++) |
2454 | srp[col] ^= RS_RVid; |
2458 | srp[col] ^= RS_RVid; |
|
|
2459 | |
|
|
2460 | while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) |
|
|
2461 | srp[col] ^= RS_RVid | RS_Uline; |
|
|
2462 | } |
2455 | } |
2463 | } |
2456 | else |
2464 | else |
2457 | #endif |
2465 | #endif |
2458 | { |
2466 | { |
2459 | if (selection.beg.row >= -view_start) |
2467 | if (selection.beg.row >= -view_start) |
… | |
… | |
2886 | #endif |
2894 | #endif |
2887 | end_col = ROW(row).is_longer () ? ncol : ROW(row).l; //TODO//FIXME//LEN |
2895 | end_col = ROW(row).is_longer () ? ncol : ROW(row).l; //TODO//FIXME//LEN |
2888 | |
2896 | |
2889 | col = max (col, 0); |
2897 | col = max (col, 0); |
2890 | |
2898 | |
2891 | if (row == selection.end.row || selection.rect) |
2899 | if (row == selection.end.row |
|
|
2900 | #if ENABLE_FRILLS |
|
|
2901 | || selection.rect |
|
|
2902 | #endif |
|
|
2903 | ) |
2892 | end_col = min (end_col, selection.end.col); |
2904 | min_it (end_col, selection.end.col); |
2893 | |
2905 | |
2894 | t = ROW(row).t + col; |
2906 | t = ROW(row).t + col; |
2895 | for (; col < end_col; col++) |
2907 | for (; col < end_col; col++) |
2896 | { |
2908 | { |
2897 | if (*t == NOCHAR) |
2909 | if (*t == NOCHAR) |
… | |
… | |
2915 | #endif |
2927 | #endif |
2916 | else |
2928 | else |
2917 | new_selection_text[ofs++] = *t++; |
2929 | new_selection_text[ofs++] = *t++; |
2918 | } |
2930 | } |
2919 | |
2931 | |
|
|
2932 | #if ENABLE_FRILLS |
|
|
2933 | if (selection.rect) |
|
|
2934 | { |
|
|
2935 | while (ofs |
|
|
2936 | && new_selection_text[ofs - 1] != C0_LF |
|
|
2937 | && unicode::is_space (new_selection_text[ofs - 1])) |
|
|
2938 | --ofs; |
|
|
2939 | |
|
|
2940 | new_selection_text[ofs++] = C0_LF; |
|
|
2941 | } |
|
|
2942 | else |
|
|
2943 | #endif |
2920 | if (!ROW(row).is_longer () && row != selection.end.row) |
2944 | if (!ROW(row).is_longer () && row != selection.end.row) |
2921 | new_selection_text[ofs++] = C0_LF; |
2945 | new_selection_text[ofs++] = C0_LF; |
2922 | } |
2946 | } |
2923 | |
2947 | |
2924 | if (end_col != selection.end.col) |
2948 | if (end_col != selection.end.col) |
2925 | new_selection_text[ofs++] = C0_LF; |
2949 | new_selection_text[ofs++] = C0_LF; |
2926 | |
2950 | |
… | |
… | |
3348 | { |
3372 | { |
3349 | stp = ROW(end_row).t; |
3373 | stp = ROW(end_row).t; |
3350 | |
3374 | |
3351 | while (--end_col >= 0) |
3375 | while (--end_col >= 0) |
3352 | { |
3376 | { |
3353 | if (stp[end_col] != ' ' |
3377 | if (stp[end_col] != NOCHAR |
3354 | && stp[end_col] != '\t' |
3378 | && !unicode::is_space (stp[end_col])) |
3355 | && stp[end_col] != NOCHAR) |
|
|
3356 | break; |
3379 | break; |
3357 | } |
3380 | } |
3358 | |
3381 | |
3359 | if (end_col >= 0 |
3382 | if (end_col >= 0 |
3360 | || !ROW(end_row - 1).is_longer ()) |
3383 | || !ROW(end_row - 1).is_longer ()) |