[wiki] [sites] [st][scrollback] Update for 4.8 || Ivan Tham

From: <git_AT_suckless.org>
Date: Fri, 16 Mar 2018 15:42:33 +0100

commit 913f730a781a3e889c4a4099fc7cd1c88c4214fe
Author: Ivan Tham <pickfire_AT_riseup.net>
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
_AT_@ -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
_AT_@ -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
-_AT_@ -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
+_AT_@ -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} },
_AT_@ -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
-_AT_@ -121,6 +121,9 @@
+diff --git a/st.c b/st.c
+index 65a0cb6..1d8c12a 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -121,6 +121,9 @@ typedef struct {
          int col; /* nb col */
          Line *line; /* screen */
          Line *alt; /* alternate screen */
_AT_@ -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 */
-_AT_@ -188,8 +191,8 @@
+_AT_@ -188,8 +191,8 @@ static void tnewline(int);
  static void tputtab(int);
  static void tputc(Rune);
  static void treset(void);
_AT_@ -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);
-_AT_@ -431,10 +434,10 @@
+_AT_@ -431,10 +434,10 @@ tlinelen(int y)
  {
          int i = term.col;
  
_AT_@ -47,7 +49,7 @@ diff -U 3 a/st.c b/st.c
                  --i;
  
          return i;
-_AT_@ -543,7 +546,7 @@
+_AT_@ -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.
                   */
_AT_@ -56,7 +58,7 @@ diff -U 3 a/st.c b/st.c
                  prevdelim = ISDELIM(prevgp->u);
                  for (;;) {
                          newx = *x + direction;
-_AT_@ -558,14 +561,14 @@
+_AT_@ -558,14 +561,14 @@ selsnap(int *x, int *y, int direction)
                                          yt = *y, xt = *x;
                                  else
                                          yt = newy, xt = newx;
_AT_@ -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)))
-_AT_@ -586,14 +589,14 @@
+_AT_@ -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) {
_AT_@ -90,7 +92,7 @@ diff -U 3 a/st.c b/st.c
                                                  & ATTR_WRAP)) {
                                          break;
                                  }
-_AT_@ -624,13 +627,13 @@
+_AT_@ -624,13 +627,13 @@ getsel(void)
                  }
  
                  if (sel.type == SEL_RECTANGULAR) {
_AT_@ -107,7 +109,7 @@ diff -U 3 a/st.c b/st.c
                  while (last >= gp && last->u == ' ')
                          --last;
  
-_AT_@ -836,6 +839,9 @@
+_AT_@ -836,6 +839,9 @@ ttyread(void)
          if (buflen > 0)
                  memmove(buf, buf + written, buflen);
  
_AT_@ -117,7 +119,7 @@ diff -U 3 a/st.c b/st.c
          return ret;
  }
  
-_AT_@ -843,6 +849,9 @@
+_AT_@ -843,6 +849,9 @@ void
  ttywrite(const char *s, size_t n, int may_echo)
  {
          const char *next;
_AT_@ -127,7 +129,7 @@ diff -U 3 a/st.c b/st.c
  
          if (may_echo && IS_SET(MODE_ECHO))
                  twrite(s, n, 1);
-_AT_@ -1054,13 +1063,54 @@
+_AT_@ -1054,13 +1063,54 @@ tswapscreen(void)
  }
  
  void
_AT_@ -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);
  
-_AT_@ -1074,13 +1124,20 @@
+_AT_@ -1074,13 +1124,20 @@ tscrolldown(int orig, int n)
  }
  
  void
_AT_@ -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);
  
-_AT_@ -1129,7 +1186,7 @@
+_AT_@ -1129,7 +1186,7 @@ tnewline(int first_col)
          int y = term.c.y;
  
          if (y == term.bot) {
_AT_@ -214,7 +216,7 @@ diff -U 3 a/st.c b/st.c
          } else {
                  y++;
          }
-_AT_@ -1294,14 +1351,14 @@
+_AT_@ -1294,14 +1351,14 @@ void
  tinsertblankline(int n)
  {
          if (BETWEEN(term.c.y, term.top, term.bot))
_AT_@ -231,7 +233,7 @@ diff -U 3 a/st.c b/st.c
  }
  
  int32_t
-_AT_@ -1730,11 +1787,11 @@
+_AT_@ -1730,11 +1787,11 @@ csihandle(void)
                  break;
          case 'S': /* SU -- Scroll <n> line up */
                  DEFAULT(csiescseq.arg[0], 1);
_AT_@ -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);
-_AT_@ -2258,7 +2315,7 @@
+_AT_@ -2258,7 +2315,7 @@ eschandle(uchar ascii)
                  return 0;
          case 'D': /* IND -- Linefeed */
                  if (term.c.y == term.bot) {
_AT_@ -254,7 +256,7 @@ diff -U 3 a/st.c b/st.c
                  } else {
                          tmoveto(term.c.x, term.c.y+1);
                  }
-_AT_@ -2271,7 +2328,7 @@
+_AT_@ -2271,7 +2328,7 @@ eschandle(uchar ascii)
                  break;
          case 'M': /* RI -- Reverse index */
                  if (term.c.y == term.top) {
_AT_@ -263,7 +265,7 @@ diff -U 3 a/st.c b/st.c
                  } else {
                          tmoveto(term.c.x, term.c.y-1);
                  }
-_AT_@ -2490,7 +2547,7 @@
+_AT_@ -2490,7 +2547,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
  void
  tresize(int col, int row)
  {
_AT_@ -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;
-_AT_@ -2527,7 +2584,15 @@
+_AT_@ -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));
  
_AT_@ -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));
-_AT_@ -2584,7 +2649,7 @@
+_AT_@ -2584,7 +2649,7 @@ drawregion(int x1, int y1, int x2, int y2)
                          continue;
  
                  term.dirty[y] = 0;
_AT_@ -298,7 +300,7 @@ diff -U 3 a/st.c b/st.c
          }
  }
  
-_AT_@ -2605,8 +2670,10 @@
+_AT_@ -2605,8 +2670,10 @@ draw(void)
                  cx--;
  
          drawregion(0, 0, term.col, term.row);
_AT_@ -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
 _AT_@ -3,6 +3,9 @@
  #include <stdint.h>
  #include <sys/types.h>
_AT_@ -333,7 +336,7 @@ diff -U 3 a/st.h b/st.h
  
  enum glyph_attribute {
          ATTR_NULL = 0,
-_AT_@ -111,6 +116,9 @@
+_AT_@ -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
_AT_@ -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
-_AT_@ -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
+_AT_@ -156,8 +156,14 @@ static unsigned int defaultattr = 11;
   */
  static MouseShortcut mshortcuts[] = {
          /* button mask string */
_AT_@ -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
-_AT_@ -81,6 +81,13 @@
+diff --git a/st.h b/st.h
+index 628e876..cdd25ae 100644
+--- a/st.h
++++ b/st.h
+_AT_@ -81,6 +81,13 @@ typedef union {
          const void *v;
  } Arg;
  
_AT_@ -35,16 +37,16 @@ diff -U 3 b/st.h n/st.h
  void die(const char *, ...);
  void redraw(void);
  void draw(void);
-_AT_@ -129,3 +136,4 @@
+_AT_@ -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
-_AT_@ -409,6 +409,7 @@
+diff --git a/x.c b/x.c
+index d43a529..754d859 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -409,6 +409,7 @@ bpress(XEvent *e)
  {
          struct timespec now;
          MouseShortcut *ms;
_AT_@ -52,11 +54,10 @@ diff -U 3 b/x.c n/x.c
          int snap;
  
          if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
-_AT_@ -423,6 +424,14 @@
- return;
+_AT_@ -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)) {
_AT_@ -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
Received on Fri Mar 16 2018 - 15:42:33 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 16 2018 - 15:48:23 CET