[wiki] [sites] [st][patch][selectioncolors] fix a bug related to cursor color || Ashish Kumar Yadav

From: <git_AT_suckless.org>
Date: Mon, 20 Jul 2020 16:19:57 +0200

commit 261787193e58ba5a3b3030b85d98f78ab964469a
Author: Ashish Kumar Yadav <ashishkumar.yadav_AT_students.iiserpune.ac.in>
Date: Mon Jul 20 19:49:51 2020 +0530

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

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
index 02b38c03..dac9a5f5 100644
--- a/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.4.diff
+++ b/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.4.diff
_AT_@ -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
 _AT_@ -119,7 +119,7 @@ static const char *colorname[] = {
  
          /* more colors can be added after 255 to use with DefaultXX */
_AT_@ -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
 _AT_@ -33,6 +33,7 @@ enum glyph_attribute {
          ATTR_WRAP = 1 << 8,
          ATTR_WIDE = 1 << 9,
_AT_@ -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
 _AT_@ -1425,6 +1425,12 @@ xdrawglyphfontspecs(const XftGlyphFontSp
                  bg = temp;
          }
_AT_@ -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;
  
-_AT_@ -1490,8 +1496,6 @@ xdrawcursor(int cx, int cy, Glyph g, int
- Color drawcol;
+_AT_@ -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))
-_AT_@ -1505,21 +1509,11 @@ xdrawcursor(int cx, int cy, Glyph g, int
+_AT_@ -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];
_AT_@ -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;
_AT_@ -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];
          }
  
-_AT_@ -1612,7 +1606,7 @@ xdrawline(Line line, int x1, int y1, int
+ /* draw the new one */
+_AT_@ -1612,7 +1608,7 @@ xdrawline(Line line, int x1, int y1, int
                  if (new.mode == ATTR_WDUMMY)
                          continue;
                  if (selected(x, y1))
Received on Mon Jul 20 2020 - 16:19:57 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 20 2020 - 16:24:42 CEST