sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 261787193e58ba5a3b3030b85d98f78ab964469a
parent c454207a99aa74e8ea7041760822b00cd507eba6
Author: Ashish Kumar Yadav <ashishkumar.yadav@students.iiserpune.ac.in>
Date:   Mon, 20 Jul 2020 19:49:51 +0530

[st][patch][selectioncolors] fix a bug related to cursor color

Diffstat:
Mst.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.4.diff | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.4.diff b/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.4.diff @@ -1,6 +1,6 @@ diff -up st-0.8.4-ori/config.def.h st-0.8.4/config.def.h --- st-0.8.4-ori/config.def.h 2020-06-19 14:59:45.000000000 +0530 -+++ st-0.8.4/config.def.h 2020-07-20 12:28:45.478010118 +0530 ++++ st-0.8.4/config.def.h 2020-07-20 19:39:32.310996650 +0530 @@ -119,7 +119,7 @@ static const char *colorname[] = { /* more colors can be added after 255 to use with DefaultXX */ @@ -28,7 +28,7 @@ diff -up st-0.8.4-ori/config.def.h st-0.8.4/config.def.h * Default shape of cursor diff -up st-0.8.4-ori/st.h st-0.8.4/st.h --- st-0.8.4-ori/st.h 2020-06-19 14:59:45.000000000 +0530 -+++ st-0.8.4/st.h 2020-07-20 12:29:40.407540957 +0530 ++++ st-0.8.4/st.h 2020-07-20 19:39:32.310996650 +0530 @@ -33,6 +33,7 @@ enum glyph_attribute { ATTR_WRAP = 1 << 8, ATTR_WIDE = 1 << 9, @@ -39,7 +39,7 @@ diff -up st-0.8.4-ori/st.h st-0.8.4/st.h diff -up st-0.8.4-ori/x.c st-0.8.4/x.c --- st-0.8.4-ori/x.c 2020-06-19 14:59:45.000000000 +0530 -+++ st-0.8.4/x.c 2020-07-20 12:52:57.571463683 +0530 ++++ st-0.8.4/x.c 2020-07-20 19:46:23.081759264 +0530 @@ -1425,6 +1425,12 @@ xdrawglyphfontspecs(const XftGlyphFontSp bg = temp; } @@ -53,18 +53,20 @@ diff -up st-0.8.4-ori/x.c st-0.8.4/x.c if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK) fg = bg; -@@ -1490,8 +1496,6 @@ xdrawcursor(int cx, int cy, Glyph g, int - Color drawcol; +@@ -1491,7 +1497,7 @@ xdrawcursor(int cx, int cy, Glyph g, int /* remove the old cursor */ -- if (selected(ox, oy)) + if (selected(ox, oy)) - og.mode ^= ATTR_REVERSE; ++ og.mode ^= ATTR_SELECTED; xdrawglyph(og, ox, oy); if (IS_SET(MODE_HIDE)) -@@ -1505,21 +1509,11 @@ xdrawcursor(int cx, int cy, Glyph g, int +@@ -1504,23 +1510,13 @@ xdrawcursor(int cx, int cy, Glyph g, int + if (IS_SET(MODE_REVERSE)) { g.mode |= ATTR_REVERSE; ++ g.fg = defaultcs; g.bg = defaultfg; - if (selected(cx, cy)) { - drawcol = dc.col[defaultcs]; @@ -74,7 +76,6 @@ diff -up st-0.8.4-ori/x.c st-0.8.4/x.c - g.fg = defaultcs; - } + drawcol = dc.col[defaultrcs]; -+ g.fg = defaultcs; } else { - if (selected(cx, cy)) { - g.fg = defaultfg; @@ -83,12 +84,14 @@ diff -up st-0.8.4-ori/x.c st-0.8.4/x.c - g.fg = defaultbg; - g.bg = defaultcs; - } +- drawcol = dc.col[g.bg]; + g.fg = defaultbg; + g.bg = defaultcs; - drawcol = dc.col[g.bg]; ++ drawcol = dc.col[defaultcs]; } -@@ -1612,7 +1606,7 @@ xdrawline(Line line, int x1, int y1, int + /* draw the new one */ +@@ -1612,7 +1608,7 @@ xdrawline(Line line, int x1, int y1, int if (new.mode == ATTR_WDUMMY) continue; if (selected(x, y1))