… | |
… | |
351 | lofs += len; |
351 | lofs += len; |
352 | qcol += len; |
352 | qcol += len; |
353 | } |
353 | } |
354 | } |
354 | } |
355 | |
355 | |
356 | qline->l = llen < ncol ? llen : MOD (llen - 1, ncol) + 1; |
356 | qline->l = llen ? MOD (llen - 1, ncol) + 1 : 0; |
|
|
357 | #ifdef DEBUG_STRICT //TODO//FIXME//TEMPORARY |
|
|
358 | if (qline->l < 0) |
|
|
359 | { |
|
|
360 | fprintf (stderr, "ERROR, PLEASE REPORT to rxvt-unicode@plan9.de: qline->l %d = llen %d < ncol %d ? %d : MOD %d\n", qline->l,llen,ncol,llen,MOD (llen - 1, ncol) + 1);//D |
|
|
361 | qline->l = 0; |
|
|
362 | } |
|
|
363 | #endif |
357 | scr_blank_line (*qline, qline->l, ncol - qline->l, DEFAULT_RSTYLE); |
364 | scr_blank_line (*qline, qline->l, ncol - qline->l, DEFAULT_RSTYLE); |
358 | } |
365 | } |
359 | while (p != pend && q > 0); |
366 | while (p != pend && q > 0); |
360 | |
367 | |
361 | term_start = total_rows - nrow; |
368 | term_start = total_rows - nrow; |
… | |
… | |
620 | { |
627 | { |
621 | selection.beg.row -= count; |
628 | selection.beg.row -= count; |
622 | selection.end.row -= count; |
629 | selection.end.row -= count; |
623 | selection.mark.row -= count; |
630 | selection.mark.row -= count; |
624 | |
631 | |
625 | selection_check (0); |
632 | if (selection.beg.row < -nsaved |
|
|
633 | || selection.end.row < -nsaved |
|
|
634 | || selection.mark.row < -nsaved) |
|
|
635 | { |
|
|
636 | CLEAR_ALL_SELECTION (); |
|
|
637 | selection.op = SELECTION_CLEAR; |
|
|
638 | } |
626 | } |
639 | } |
627 | |
640 | |
628 | for (int i = count; i--; ) |
641 | for (int i = count; i--; ) |
|
|
642 | { |
|
|
643 | ROW(row2 - i).l = 0; |
629 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
644 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
|
|
645 | } |
630 | |
646 | |
631 | if ((options & Opt_scrollWithBuffer) |
647 | if ((options & Opt_scrollWithBuffer) |
632 | && view_start != 0 |
648 | && view_start != 0 |
633 | && view_start != saveLines) |
649 | && view_start != saveLines) |
634 | scr_page (UP, count); |
650 | scr_page (UP, count); |
635 | } |
651 | } |
636 | else |
652 | else |
637 | { |
653 | { |
638 | if (selection.op && current_screen == selection.screen) |
654 | if (selection.op && current_screen == selection.screen) |
639 | { |
655 | { |
640 | int i = selection.beg.row; |
656 | if ((selection.beg.row < row1 && selection.end.row > row1) |
641 | int j = selection.end.row; |
657 | || (selection.beg.row < row2 && selection.end.row > row2) |
642 | |
|
|
643 | if ((i < row1 && j > row1) |
|
|
644 | || (i < row2 && j > row2) |
|
|
645 | || (i - count < row1 && i >= row1) |
658 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
646 | || (i - count > row2 && i <= row2) |
659 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
647 | || (j - count < row1 && j >= row1) |
660 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
648 | || (j - count > row2 && j <= row2)) |
661 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
649 | { |
662 | { |
650 | CLEAR_ALL_SELECTION (); |
663 | CLEAR_ALL_SELECTION (); |
651 | selection.op = SELECTION_CLEAR; /* XXX: too aggressive? */ |
664 | selection.op = SELECTION_CLEAR; |
652 | } |
665 | } |
653 | else if (j >= row1 && j <= row2) |
666 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
654 | { |
667 | { |
655 | /* move selected region too */ |
668 | /* move selected region too */ |
656 | selection.beg.row -= count; |
669 | selection.beg.row -= count; |
657 | selection.end.row -= count; |
670 | selection.end.row -= count; |
658 | selection.mark.row -= count; |
671 | selection.mark.row -= count; |
… | |
… | |
730 | { |
743 | { |
731 | c = *str++; |
744 | c = *str++; |
732 | |
745 | |
733 | if (c < 0x20) |
746 | if (c < 0x20) |
734 | if (c == C0_LF) |
747 | if (c == C0_LF) |
735 | { |
748 | { |
736 | if (!line->is_longer ()) /* XXX: think about this */ |
749 | if (!line->is_longer ()) /* XXX: think about this */ |
737 | max_it (line->l, screen.cur.col); |
750 | max_it (line->l, screen.cur.col); |
738 | |
751 | |
739 | screen.flags &= ~Screen_WrapNext; |
752 | screen.flags &= ~Screen_WrapNext; |
740 | |
753 | |
… | |
… | |
1280 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1293 | XChangeGC (display->display, gc, GCForeground, &gcvalue); |
1281 | } |
1294 | } |
1282 | |
1295 | |
1283 | for (; num--; row++) |
1296 | for (; num--; row++) |
1284 | { |
1297 | { |
|
|
1298 | ROW (row).l = 0; |
1285 | scr_blank_screen_mem (ROW (row), rstyle); |
1299 | scr_blank_screen_mem (ROW (row), rstyle); |
1286 | ROW (row).l = 0; |
|
|
1287 | scr_blank_line (drawn_buf [row], 0, ncol, ren); |
1300 | scr_blank_line (drawn_buf [row], 0, ncol, ren); |
1288 | } |
1301 | } |
1289 | } |
1302 | } |
1290 | |
1303 | |
1291 | #if ENABLE_FRILLS |
1304 | #if ENABLE_FRILLS |
… | |
… | |
2177 | * Determine the attributes for the string |
2190 | * Determine the attributes for the string |
2178 | */ |
2191 | */ |
2179 | int fore = GET_FGCOLOR (rend); // desired foreground |
2192 | int fore = GET_FGCOLOR (rend); // desired foreground |
2180 | int back = GET_BGCOLOR (rend); // desired background |
2193 | int back = GET_BGCOLOR (rend); // desired background |
2181 | |
2194 | |
2182 | // only do special processing if any attributes are set, which is rare |
2195 | // only do special processing if any attributes are set, which is unlikely |
2183 | 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)) |
2184 | { |
2197 | { |
2185 | #if ENABLE_STYLES |
2198 | #if ENABLE_STYLES |
2186 | // force redraw after "careful" characters to avoid pixel droppings |
2199 | // force redraw after "careful" characters to avoid pixel droppings |
2187 | if (srp[col] & RS_Careful && col < ncol - 1 && 0) |
2200 | if (srp[col] & RS_Careful && col < ncol - 1 && 0) |
… | |
… | |
2435 | |
2448 | |
2436 | #if ENABLE_FRILLS |
2449 | #if ENABLE_FRILLS |
2437 | if (selection.rect) |
2450 | if (selection.rect) |
2438 | { |
2451 | { |
2439 | 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 | |
2440 | 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++) |
2441 | 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 | } |
2442 | } |
2463 | } |
2443 | else |
2464 | else |
2444 | #endif |
2465 | #endif |
2445 | { |
2466 | { |
2446 | if (selection.beg.row >= -view_start) |
2467 | if (selection.beg.row >= -view_start) |
… | |
… | |
2449 | row = selection.beg.row; |
2470 | row = selection.beg.row; |
2450 | } |
2471 | } |
2451 | else |
2472 | else |
2452 | { |
2473 | { |
2453 | col = 0; |
2474 | col = 0; |
2454 | row = view_start; |
2475 | row = -view_start; |
2455 | } |
2476 | } |
2456 | |
2477 | |
2457 | for (; row < min (selection.end.row, view_end); row++, col = 0) |
2478 | for (; row < min (selection.end.row, view_end); row++, col = 0) |
2458 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
2479 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
2459 | srp[col] ^= RS_RVid; |
2480 | srp[col] ^= RS_RVid; |
… | |
… | |
2873 | #endif |
2894 | #endif |
2874 | 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 |
2875 | |
2896 | |
2876 | col = max (col, 0); |
2897 | col = max (col, 0); |
2877 | |
2898 | |
2878 | if (row == selection.end.row || selection.rect) |
2899 | if (row == selection.end.row |
|
|
2900 | #if ENABLE_FRILLS |
|
|
2901 | || selection.rect |
|
|
2902 | #endif |
|
|
2903 | ) |
2879 | end_col = min (end_col, selection.end.col); |
2904 | min_it (end_col, selection.end.col); |
2880 | |
2905 | |
2881 | t = ROW(row).t + col; |
2906 | t = ROW(row).t + col; |
2882 | for (; col < end_col; col++) |
2907 | for (; col < end_col; col++) |
2883 | { |
2908 | { |
2884 | if (*t == NOCHAR) |
2909 | if (*t == NOCHAR) |
… | |
… | |
2902 | #endif |
2927 | #endif |
2903 | else |
2928 | else |
2904 | new_selection_text[ofs++] = *t++; |
2929 | new_selection_text[ofs++] = *t++; |
2905 | } |
2930 | } |
2906 | |
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 |
2907 | if (!ROW(row).is_longer () && row != selection.end.row) |
2944 | if (!ROW(row).is_longer () && row != selection.end.row) |
2908 | new_selection_text[ofs++] = C0_LF; |
2945 | new_selection_text[ofs++] = C0_LF; |
2909 | } |
2946 | } |
2910 | |
2947 | |
2911 | if (end_col != selection.end.col) |
2948 | if (end_col != selection.end.col) |
2912 | new_selection_text[ofs++] = C0_LF; |
2949 | new_selection_text[ofs++] = C0_LF; |
2913 | |
2950 | |
… | |
… | |
3335 | { |
3372 | { |
3336 | stp = ROW(end_row).t; |
3373 | stp = ROW(end_row).t; |
3337 | |
3374 | |
3338 | while (--end_col >= 0) |
3375 | while (--end_col >= 0) |
3339 | { |
3376 | { |
3340 | if (stp[end_col] != ' ' |
3377 | if (stp[end_col] != NOCHAR |
3341 | && stp[end_col] != '\t' |
3378 | && !unicode::is_space (stp[end_col])) |
3342 | && stp[end_col] != NOCHAR) |
|
|
3343 | break; |
3379 | break; |
3344 | } |
3380 | } |
3345 | |
3381 | |
3346 | if (end_col >= 0 |
3382 | if (end_col >= 0 |
3347 | || !ROW(end_row - 1).is_longer ()) |
3383 | || !ROW(end_row - 1).is_longer ()) |
… | |
… | |
3663 | for (int y = ov_h; y--; ) |
3699 | for (int y = ov_h; y--; ) |
3664 | { |
3700 | { |
3665 | text_t *t1 = ov_text[y]; |
3701 | text_t *t1 = ov_text[y]; |
3666 | rend_t *r1 = ov_rend[y]; |
3702 | rend_t *r1 = ov_rend[y]; |
3667 | |
3703 | |
3668 | text_t *t2 = ROW(y - view_start).t + ov_x; |
3704 | text_t *t2 = ROW(y + ov_y - view_start).t + ov_x; |
3669 | rend_t *r2 = ROW(y - view_start).r + ov_x; |
3705 | rend_t *r2 = ROW(y + ov_y - view_start).r + ov_x; |
3670 | |
3706 | |
3671 | for (int x = ov_w; x--; ) |
3707 | for (int x = ov_w; x--; ) |
3672 | { |
3708 | { |
3673 | text_t t = *t1; *t1++ = *t2; *t2++ = t; |
3709 | text_t t = *t1; *t1++ = *t2; *t2++ = t; |
3674 | rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, FONTSET (r)->find_font (t)); |
3710 | rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, FONTSET (r)->find_font (t)); |