commit 913f730a781a3e889c4a4099fc7cd1c88c4214fe
Author: Ivan Tham <[email protected]>
Date:   Fri Mar 16 22:42:22 2018 +0800

    [st][scrollback] Update for 4.8

diff --git a/st.suckless.org/patches/scrollback/index.md 
b/st.suckless.org/patches/scrollback/index.md
index 8797a872..c45111e1 100644
--- a/st.suckless.org/patches/scrollback/index.md
+++ b/st.suckless.org/patches/scrollback/index.md
@@ -11,19 +11,19 @@ Download
 
 * [st-scrollback-0.7.diff](st-scrollback-0.7.diff)
 * [st-scrollback-20170329-149c0d3.diff](st-scrollback-20170329-149c0d3.diff)
-* [st-scrollback-20180311-c5ba9c0.diff](st-scrollback-20180311-c5ba9c0.diff)
+* [st-scrollback-0.8.diff](st-scrollback-0.8.diff)
 
 Apply the following patch on top of the previous to allow scrolling
 using `Shift+MouseWheel`.
 
 * 
[st-scrollback-mouse-20170427-5a10aca.diff](st-scrollback-mouse-20170427-5a10aca.diff)
-* 
[st-scrollback-mouse-20180311-c5ba9c0.diff](st-scrollback-mouse-20180311-c5ba9c0.diff)
+* [st-scrollback-mouse-0.8.diff](st-scrollback-mouse-0.8.diff)
 
 Apply the following patch on top of the previous two to allow scrollback using
 mouse wheel only when not in `MODE_ALTSCREEN`. For example the content is being
 scrolled instead of the scrollback buffer in `less`. Consequently the Shift
-modifier for scrolling is not needed anymore.  **Note: It might break other
-mkeys excluding scrolling functions.**
+modifier for scrolling is not needed anymore. **Note: It might break mkeys
+other than scrolling functions.**
 
 * 
[st-scrollback-mouse-altscreen-20170427-5a10aca.diff](st-scrollback-mouse-altscreen-20170427-5a10aca.diff)
 * 
[st-scrollback-mouse-altscreen-0.8.diff](st-scrollback-mouse-altscreen-0.8.diff)
diff --git 
a/st.suckless.org/patches/scrollback/st-scrollback-20180311-c5ba9c0.diff 
b/st.suckless.org/patches/scrollback/st-scrollback-0.8.diff
old mode 100755
new mode 100644
similarity index 85%
rename from 
st.suckless.org/patches/scrollback/st-scrollback-20180311-c5ba9c0.diff
rename to st.suckless.org/patches/scrollback/st-scrollback-0.8.diff
index f690d92d..bd71589b
--- a/st.suckless.org/patches/scrollback/st-scrollback-20180311-c5ba9c0.diff
+++ b/st.suckless.org/patches/scrollback/st-scrollback-0.8.diff
@@ -1,7 +1,8 @@
-diff -U 3 a/config.def.h b/config.def.h
---- a/config.def.h     2018-03-10 17:55:12.445254900 -0500
-+++ b/config.def.h     2018-03-10 23:55:54.468236300 -0500
-@@ -178,6 +178,8 @@
+diff --git a/config.def.h b/config.def.h
+index 82b1b09..27d42ca 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -178,6 +178,8 @@ static Shortcut shortcuts[] = {
        { TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
        { TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
        { TERMMOD,              XK_I,           iso14755,       {.i =  0} },
@@ -10,10 +11,11 @@ diff -U 3 a/config.def.h b/config.def.h
  };
  
  /*
-diff -U 3 a/st.c b/st.c
---- a/st.c     2018-03-10 17:55:12.449266800 -0500
-+++ b/st.c     2018-03-11 00:36:36.437966200 -0500
-@@ -121,6 +121,9 @@
+diff --git a/st.c b/st.c
+index 65a0cb6..1d8c12a 100644
+--- a/st.c
++++ b/st.c
+@@ -121,6 +121,9 @@ typedef struct {
        int col;      /* nb col */
        Line *line;   /* screen */
        Line *alt;    /* alternate screen */
@@ -23,7 +25,7 @@ diff -U 3 a/st.c b/st.c
        int *dirty;   /* dirtyness of lines */
        TCursor c;    /* cursor */
        int ocx;      /* old cursor col */
-@@ -188,8 +191,8 @@
+@@ -188,8 +191,8 @@ static void tnewline(int);
  static void tputtab(int);
  static void tputc(Rune);
  static void treset(void);
@@ -34,7 +36,7 @@ diff -U 3 a/st.c b/st.c
  static void tsetattr(int *, int);
  static void tsetchar(Rune, Glyph *, int, int);
  static void tsetdirt(int, int);
-@@ -431,10 +434,10 @@
+@@ -431,10 +434,10 @@ tlinelen(int y)
  {
        int i = term.col;
  
@@ -47,7 +49,7 @@ diff -U 3 a/st.c b/st.c
                --i;
  
        return i;
-@@ -543,7 +546,7 @@
+@@ -543,7 +546,7 @@ selsnap(int *x, int *y, int direction)
                 * Snap around if the word wraps around at the end or
                 * beginning of a line.
                 */
@@ -56,7 +58,7 @@ diff -U 3 a/st.c b/st.c
                prevdelim = ISDELIM(prevgp->u);
                for (;;) {
                        newx = *x + direction;
-@@ -558,14 +561,14 @@
+@@ -558,14 +561,14 @@ selsnap(int *x, int *y, int direction)
                                        yt = *y, xt = *x;
                                else
                                        yt = newy, xt = newx;
@@ -73,7 +75,7 @@ diff -U 3 a/st.c b/st.c
                        delim = ISDELIM(gp->u);
                        if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
                                        || (delim && gp->u != prevgp->u)))
-@@ -586,14 +589,14 @@
+@@ -586,14 +589,14 @@ selsnap(int *x, int *y, int direction)
                *x = (direction < 0) ? 0 : term.col - 1;
                if (direction < 0) {
                        for (; *y > 0; *y += direction) {
@@ -90,7 +92,7 @@ diff -U 3 a/st.c b/st.c
                                                & ATTR_WRAP)) {
                                        break;
                                }
-@@ -624,13 +627,13 @@
+@@ -624,13 +627,13 @@ getsel(void)
                }
  
                if (sel.type == SEL_RECTANGULAR) {
@@ -107,7 +109,7 @@ diff -U 3 a/st.c b/st.c
                while (last >= gp && last->u == ' ')
                        --last;
  
-@@ -836,6 +839,9 @@
+@@ -836,6 +839,9 @@ ttyread(void)
        if (buflen > 0)
                memmove(buf, buf + written, buflen);
  
@@ -117,7 +119,7 @@ diff -U 3 a/st.c b/st.c
        return ret;
  }
  
-@@ -843,6 +849,9 @@
+@@ -843,6 +849,9 @@ void
  ttywrite(const char *s, size_t n, int may_echo)
  {
        const char *next;
@@ -127,7 +129,7 @@ diff -U 3 a/st.c b/st.c
  
        if (may_echo && IS_SET(MODE_ECHO))
                twrite(s, n, 1);
-@@ -1054,13 +1063,54 @@
+@@ -1054,13 +1063,54 @@ tswapscreen(void)
  }
  
  void
@@ -183,7 +185,7 @@ diff -U 3 a/st.c b/st.c
        tsetdirt(orig, term.bot-n);
        tclearregion(0, term.bot-n+1, term.col-1, term.bot);
  
-@@ -1074,13 +1124,20 @@
+@@ -1074,13 +1124,20 @@ tscrolldown(int orig, int n)
  }
  
  void
@@ -205,7 +207,7 @@ diff -U 3 a/st.c b/st.c
        tclearregion(0, orig, term.col-1, orig+n-1);
        tsetdirt(orig+n, term.bot);
  
-@@ -1129,7 +1186,7 @@
+@@ -1129,7 +1186,7 @@ tnewline(int first_col)
        int y = term.c.y;
  
        if (y == term.bot) {
@@ -214,7 +216,7 @@ diff -U 3 a/st.c b/st.c
        } else {
                y++;
        }
-@@ -1294,14 +1351,14 @@
+@@ -1294,14 +1351,14 @@ void
  tinsertblankline(int n)
  {
        if (BETWEEN(term.c.y, term.top, term.bot))
@@ -231,7 +233,7 @@ diff -U 3 a/st.c b/st.c
  }
  
  int32_t
-@@ -1730,11 +1787,11 @@
+@@ -1730,11 +1787,11 @@ csihandle(void)
                break;
        case 'S': /* SU -- Scroll <n> line up */
                DEFAULT(csiescseq.arg[0], 1);
@@ -245,7 +247,7 @@ diff -U 3 a/st.c b/st.c
                break;
        case 'L': /* IL -- Insert <n> blank lines */
                DEFAULT(csiescseq.arg[0], 1);
-@@ -2258,7 +2315,7 @@
+@@ -2258,7 +2315,7 @@ eschandle(uchar ascii)
                return 0;
        case 'D': /* IND -- Linefeed */
                if (term.c.y == term.bot) {
@@ -254,7 +256,7 @@ diff -U 3 a/st.c b/st.c
                } else {
                        tmoveto(term.c.x, term.c.y+1);
                }
-@@ -2271,7 +2328,7 @@
+@@ -2271,7 +2328,7 @@ eschandle(uchar ascii)
                break;
        case 'M': /* RI -- Reverse index */
                if (term.c.y == term.top) {
@@ -263,7 +265,7 @@ diff -U 3 a/st.c b/st.c
                } else {
                        tmoveto(term.c.x, term.c.y-1);
                }
-@@ -2490,7 +2547,7 @@
+@@ -2490,7 +2547,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
  void
  tresize(int col, int row)
  {
@@ -272,7 +274,7 @@ diff -U 3 a/st.c b/st.c
        int minrow = MIN(row, term.row);
        int mincol = MIN(col, term.col);
        int *bp;
-@@ -2527,7 +2584,15 @@
+@@ -2527,7 +2584,15 @@ tresize(int col, int row)
        term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
        term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
  
@@ -289,7 +291,7 @@ diff -U 3 a/st.c b/st.c
        for (i = 0; i < minrow; i++) {
                term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
                term.alt[i]  = xrealloc(term.alt[i],  col * sizeof(Glyph));
-@@ -2584,7 +2649,7 @@
+@@ -2584,7 +2649,7 @@ drawregion(int x1, int y1, int x2, int y2)
                        continue;
  
                term.dirty[y] = 0;
@@ -298,7 +300,7 @@ diff -U 3 a/st.c b/st.c
        }
  }
  
-@@ -2605,8 +2670,10 @@
+@@ -2605,8 +2670,10 @@ draw(void)
                cx--;
  
        drawregion(0, 0, term.col, term.row);
@@ -311,9 +313,10 @@ diff -U 3 a/st.c b/st.c
        term.ocx = cx, term.ocy = term.c.y;
        xfinishdraw();
  }
-diff -U 3 a/st.h b/st.h
---- a/st.h     2018-03-10 17:55:12.453776400 -0500
-+++ b/st.h     2018-03-11 00:25:11.590522500 -0500
+diff --git a/st.h b/st.h
+index dac64d8..628e876 100644
+--- a/st.h
++++ b/st.h
 @@ -3,6 +3,9 @@
  #include <stdint.h>
  #include <sys/types.h>
@@ -333,7 +336,7 @@ diff -U 3 a/st.h b/st.h
  
  enum glyph_attribute {
        ATTR_NULL       = 0,
-@@ -111,6 +116,9 @@
+@@ -111,6 +116,9 @@ void *xmalloc(size_t);
  void *xrealloc(void *, size_t);
  char *xstrdup(char *);
  
diff --git 
a/st.suckless.org/patches/scrollback/st-scrollback-mouse-20180311-c5ba9c0.diff 
b/st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff
old mode 100755
new mode 100644
similarity index 70%
rename from 
st.suckless.org/patches/scrollback/st-scrollback-mouse-20180311-c5ba9c0.diff
rename to st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff
index 232be0fb..d817b66b
--- 
a/st.suckless.org/patches/scrollback/st-scrollback-mouse-20180311-c5ba9c0.diff
+++ b/st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff
@@ -1,7 +1,8 @@
-diff -U 3 b/config.def.h n/config.def.h
---- b/config.def.h     2018-03-11 01:28:05.373079100 -0500
-+++ n/config.def.h     2018-03-11 01:28:33.915179100 -0500
-@@ -156,8 +156,14 @@
+diff --git a/config.def.h b/config.def.h
+index 27d42ca..feec7e2 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -156,8 +156,14 @@ static unsigned int defaultattr = 11;
   */
  static MouseShortcut mshortcuts[] = {
        /* button               mask            string */
@@ -18,10 +19,11 @@ diff -U 3 b/config.def.h n/config.def.h
  };
  
  /* Internal keyboard shortcuts. */
-diff -U 3 b/st.h n/st.h
---- b/st.h     2018-03-11 01:28:05.382581000 -0500
-+++ n/st.h     2018-03-11 01:28:33.918187000 -0500
-@@ -81,6 +81,13 @@
+diff --git a/st.h b/st.h
+index 628e876..cdd25ae 100644
+--- a/st.h
++++ b/st.h
+@@ -81,6 +81,13 @@ typedef union {
        const void *v;
  } Arg;
  
@@ -35,16 +37,16 @@ diff -U 3 b/st.h n/st.h
  void die(const char *, ...);
  void redraw(void);
  void draw(void);
-@@ -129,3 +136,4 @@
+@@ -129,3 +136,4 @@ extern char *termname;
  extern unsigned int tabspaces;
  extern unsigned int defaultfg;
  extern unsigned int defaultbg;
 +extern MouseKey mkeys[];
-Only in n/: st.h.orig
-diff -U 3 b/x.c n/x.c
---- b/x.c      2018-03-11 01:28:05.240708700 -0500
-+++ n/x.c      2018-03-11 01:28:33.923701700 -0500
-@@ -409,6 +409,7 @@
+diff --git a/x.c b/x.c
+index d43a529..754d859 100644
+--- a/x.c
++++ b/x.c
+@@ -409,6 +409,7 @@ bpress(XEvent *e)
  {
        struct timespec now;
        MouseShortcut *ms;
@@ -52,11 +54,10 @@ diff -U 3 b/x.c n/x.c
        int snap;
  
        if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
-@@ -423,6 +424,14 @@
-                       return;
+@@ -424,6 +425,14 @@ bpress(XEvent *e)
                }
        }
-+ 
+ 
 +      for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) {
 +              if (e->xbutton.button == mk->b
 +                              && match(mk->mask, e->xbutton.state)) {
@@ -64,6 +65,7 @@ diff -U 3 b/x.c n/x.c
 +                      return;
 +              }
 +      }
- 
++
        if (e->xbutton.button == Button1) {
                /*
+                * If the user clicks below predefined timeouts specific


Reply via email to