Make OSC 17 apply to highlightColor.
Make highlightColor apply also to selected cells with reverse video.
Add highlightTextColor resource to change the foreground colour of
highlighted characters.
Use the specified colour to display underlined characters when the
foreground colour is the default.
-=item B<colorRV:> I<colour>
-
-Use the specified colour as the background for reverse video characters
-when OPTION_HC is disabled (--disable-frills).
-
=item B<underlineColor:> I<colour>
If set, use the specified colour as the colour for the underline
itself. If unset, use the foreground colour.
+=item B<highlightColor:> I<colour>
+
+If set, use the specified colour as the background for highlighted
+characters. If unset, use reverse video.
+
+=item B<highlightTextColor:> I<colour>
+
+If set and highlightColor is set, use the specified colour as the
+foreground for highlighted characters.
+
=item B<cursorColor:> I<colour>
Use the specified colour for the cursor. The default is to use the
case XTerm_Color_pointer_bg:
process_color_seq (op, Color_pointer_bg, str, resp);
break;
-#ifndef NO_BOLD_UNDERLINE_REVERSE
- case XTerm_Color_RV:
- process_color_seq (op, Color_RV, str, resp);
+#ifdef OPTION_HC
+ case XTerm_Color_HC:
+ process_color_seq (op, Color_HC, str, resp);
break;
+#endif
+#ifndef NO_BOLD_UNDERLINE_REVERSE
case Rxvt_Color_BD:
case URxvt_Color_BD:
process_color_seq (op, Color_BD, str, resp);
// toggle this to force redraw, must be != RS_Careful and otherwise "pretty neutral"
#define RS_redraw (2UL << RS_fontShift)
+#define RS_Sel (1UL << 22)
+
// 5 custom bits for extensions
#define RS_customCount 16UL
#define RS_customShift 23
XTerm_Color_pointer_bg = 14, // change actual 'Pointer' bg color
XTerm_Color05 = 15, // not implemented (tektronix fg)
XTerm_Color06 = 16, // not implemented (tektronix bg)
- XTerm_Color_RV = 17, // change actual 'Highlight' color
+ XTerm_Color_HC = 17, // change actual 'Highlight' color
XTerm_logfile = 46, // not implemented
XTerm_font = 50,
{
char *fontdesc;
- enum { fontCount = 15 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
+ enum { fontCount = 7 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
enum { firstFont = 2 }; // index of first font in set
rxvt_fontset (rxvt_term *term);
int back = bgcolor_of (rend); // desired background
// only do special processing if any attributes are set, which is unlikely
- if (expect_false (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)))
+ if (expect_false (rend & (RS_baseattrMask | RS_Careful | RS_Sel)))
{
bool invert = rend & RS_RVid;
fore = Color_UL;
#endif
- if (invert)
- {
#ifdef OPTION_HC
- if ((showcursor && row == screen.cur.row && text - stp == screen.cur.col)
- || !ISSET_PIXCOLOR (Color_HC))
+ if (rend & RS_Sel)
+ {
+ /* invert the column if no highlightColor is set or it is the
+ * current cursor column */
+ if (!(showcursor && row == screen.cur.row && text - stp == screen.cur.col)
+ && ISSET_PIXCOLOR (Color_HC))
+ {
+ if (ISSET_PIXCOLOR (Color_HTC))
+ fore = Color_HTC;
+ // if invert is 0 reverse video is set so we use bg color as fg color
+ else if (!invert)
+ fore = back;
+ back = Color_HC;
+ invert = 0;
+ }
+ }
#endif
- /* invert the column if no highlightColor is set or it is the
- * current cursor column */
+
+ if (invert)
+ {
::swap (fore, back);
-#ifdef OPTION_HC
- else if (ISSET_PIXCOLOR (Color_HC))
- back = Color_HC;
-#endif
#ifndef NO_BOLD_UNDERLINE_REVERSE
-# ifndef OPTION_HC
- if (ISSET_PIXCOLOR (Color_RV))
- back = Color_RV;
-# endif
if (fore == back)
{
fore = Color_bg;
if (selection.rect)
scr_xor_rect (selection.beg.row, selection.beg.col,
selection.end.row, selection.end.col,
- RS_RVid, RS_RVid | RS_Uline);
+ RS_Sel | RS_RVid, RS_Sel | RS_RVid | RS_Uline);
else
#endif
scr_xor_span (selection.beg.row, selection.beg.col,
selection.end.row, selection.end.col,
- RS_RVid);
+ RS_Sel | RS_RVid);
}
}