dynamic cursor color: visual bug on selection ref. #169

This commit is contained in:
Bakkeby 2025-02-27 21:57:48 +01:00 committed by Antoine Vaure
parent 9860867e10
commit 5d5fe76795

14
x.c
View file

@ -2747,21 +2747,19 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
XRenderColor colbg; XRenderColor colbg;
#endif // DYNAMIC_CURSOR_COLOR_PATCH #endif // DYNAMIC_CURSOR_COLOR_PATCH
#if !DYNAMIC_CURSOR_COLOR_PATCH || SELECTION_COLORS_PATCH #if LIGATURES_PATCH
/* remove the old cursor */ /* Redraw the line where cursor was previously.
* It will restore the ligatures broken by the cursor. */
xdrawline(line, 0, oy, len);
#else
/* Remove the old cursor */
if (selected(ox, oy)) if (selected(ox, oy))
#if SELECTION_COLORS_PATCH #if SELECTION_COLORS_PATCH
og.mode |= ATTR_SELECTED; og.mode |= ATTR_SELECTED;
#else #else
og.mode ^= ATTR_REVERSE; og.mode ^= ATTR_REVERSE;
#endif // SELECTION_COLORS_PATCH #endif // SELECTION_COLORS_PATCH
#endif // DYNAMIC_CURSOR_COLOR_PATCH
#if LIGATURES_PATCH
/* Redraw the line where cursor was previously.
* It will restore the ligatures broken by the cursor. */
xdrawline(line, 0, oy, len);
#else
xdrawglyph(og, ox, oy); xdrawglyph(og, ox, oy);
#endif // LIGATURES_PATCH #endif // LIGATURES_PATCH