st-spoiler-20170802-e2ee5ee.diff (453B)
1 diff --git a/x.c b/x.c 2 index 6474a01..8ecfec0 100644 3 --- a/x.c 4 +++ b/x.c 5 @@ -1188,9 +1188,14 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i 6 } 7 8 if (base.mode & ATTR_REVERSE) { 9 - temp = fg; 10 - fg = bg; 11 - bg = temp; 12 + if (bg == fg) { 13 + bg = &dc.col[defaultfg]; 14 + fg = &dc.col[defaultbg]; 15 + } else { 16 + temp = fg; 17 + fg = bg; 18 + bg = temp; 19 + } 20 } 21 22 if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {