--- rxvt-unicode/src/screen.C 2005/12/27 01:46:06 1.199 +++ rxvt-unicode/src/screen.C 2005/12/31 19:30:25 1.203 @@ -48,7 +48,7 @@ * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * * ------------------------------------------------------------------------- */ #define ZERO_SCROLLBACK() \ - if (options & Opt_scrollTtyOutput) \ + if (OPTION (Opt_scrollTtyOutput)) \ view_start = 0 #define CLEAR_SELECTION() \ selection.beg.row = selection.beg.col \ @@ -532,7 +532,7 @@ screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1); #if NSCREENS - if (options & Opt_secondaryScreen) + if (OPTION (Opt_secondaryScreen)) { num_scr = 0; @@ -546,7 +546,7 @@ } else #endif - if (options & Opt_secondaryScroll) + if (OPTION (Opt_secondaryScroll)) scr_scroll_text (0, prev_nrow - 1, prev_nrow); return scrn; @@ -618,7 +618,7 @@ if (count > 0 && row1 == 0 && row2 == nrow - 1 - && (current_screen == PRIMARY || options & Opt_secondaryScroll)) + && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll))) { nsaved = min (nsaved + count, saveLines); term_start = (term_start + count) % total_rows; @@ -644,7 +644,7 @@ scr_blank_screen_mem (ROW(row2 - i), rstyle); } - if ((options & Opt_scrollWithBuffer) + if (OPTION (Opt_scrollWithBuffer) && view_start != 0 && view_start != saveLines) scr_page (UP, count); @@ -1020,7 +1020,7 @@ // store horizontal tab commands as characters inside the text // buffer so they can be selected and pasted. - if (ht && options & Opt_pastableTabs) + if (ht && OPTION (Opt_pastableTabs)) { base_rend = SET_FONT (base_rend, 0); @@ -1286,7 +1286,7 @@ else { ren = rstyle & (RS_fgMask | RS_bgMask); - gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)]; + gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; XChangeGC (display->display, gc, GCForeground, &gcvalue); ERASE_ROWS (row, num); gcvalue.foreground = pix_colors[Color_fg]; @@ -1595,7 +1595,7 @@ if (bgPixmap.pixmap == None) #endif #if TRANSPARENT - if (! (options & Opt_transparent) || am_transparent == 0) + if (! OPTION (Opt_transparent) || am_transparent == 0) #endif XSetWindowBackground (display->display, vt, pix_colors[Color_bg]); @@ -1838,12 +1838,12 @@ # ifndef NO_MAPALERT # ifdef MAPALERT_OPTION - if (options & Opt_mapAlert) + if (OPTION (Opt_mapAlert)) # endif XMapWindow (display->display, parent[0]); # endif - if (options & Opt_visualBell) + if (OPTION (Opt_visualBell)) { scr_rvideo_mode (!rvideo); /* refresh also done */ rxvt_usleep (VISUAL_BELL_DURATION); @@ -1944,7 +1944,7 @@ must_clear |= bgPixmap.pixmap != None; #endif #if TRANSPARENT - must_clear |= (options & Opt_transparent) && am_transparent; + must_clear |= OPTION (Opt_transparent) && am_transparent; #endif ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ @@ -1978,7 +1978,7 @@ if (showcursor && focus) { - if (options & Opt_cursorUnderline) + if (OPTION (Opt_cursorUnderline)) *crp ^= RS_Uline; else { @@ -1990,7 +1990,7 @@ ccol1 = Color_cursor; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR - ccol1 = GET_FGCOLOR (rstyle); + ccol1 = fgcolor_of (rstyle); #else ccol1 = Color_fg; #endif @@ -1998,7 +1998,7 @@ ccol2 = Color_cursor2; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR - ccol2 = GET_BGCOLOR (rstyle); + ccol2 = bgcolor_of (rstyle); #else ccol2 = Color_bg; #endif @@ -2189,8 +2189,8 @@ /* * Determine the attributes for the string */ - int fore = GET_FGCOLOR (rend); // desired foreground - int back = GET_BGCOLOR (rend); // desired background + int fore = fgcolor_of (rend); // desired foreground + int back = bgcolor_of (rend); // desired background // only do special processing if any attributes are set, which is unlikely if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) @@ -2321,7 +2321,7 @@ { if (focus) { - if (options & Opt_cursorUnderline) + if (OPTION (Opt_cursorUnderline)) *crp ^= RS_Uline; else { @@ -2459,6 +2459,9 @@ while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) srp[col] ^= RS_RVid | RS_Uline; + + if (++col < selection.end.col) + srp[col] ^= RS_RVid | RS_Uline; } } else @@ -2896,7 +2899,11 @@ col = max (col, 0); - if (row == selection.end.row || selection.rect) + if (row == selection.end.row +#if ENABLE_FRILLS + || selection.rect +#endif + ) min_it (end_col, selection.end.col); t = ROW(row).t + col; @@ -3299,7 +3306,7 @@ else if (selection.clicks == 3) { #if ENABLE_FRILLS - if (options & Opt_tripleclickwords) + if (OPTION (Opt_tripleclickwords)) { selection_delimit_word (UP, &selection.beg, &selection.beg);