[wiki] [sites] [st] Update scrollback mouse || Ivan Tham

From: <git_AT_suckless.org>
Date: Wed, 16 Sep 2015 16:55:16 +0200

commit 6ad4a66113494809772a09144ac844195371850b
Author: Ivan Tham <pickfire_AT_riseup.net>
Date: Wed Sep 16 22:55:09 2015 +0800

    [st] Update scrollback mouse

diff --git a/st.suckless.org/patches/st-scrollback-shift-mouse.diff b/st.suckless.org/patches/st-scrollback-shift-mouse.diff
index d61eb83..04535ec 100644
--- a/st.suckless.org/patches/st-scrollback-shift-mouse.diff
+++ b/st.suckless.org/patches/st-scrollback-shift-mouse.diff
_AT_@ -1,16 +1,16 @@
 diff --git a/config.def.h b/config.def.h
-index 930e468..0601fe5 100644
+index b6adc5e..6c98b36 100644
 --- a/config.def.h
 +++ b/config.def.h
 _AT_@ -7,6 +7,7 @@
   */
- static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
+ static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
  static int borderpx = 2;
 +static int histsize = 2000;
  
  /*
   * What program is execed by st depends of these precedence rules:
-_AT_@ -123,10 +124,16 @@ static unsigned int defaultunderline = 7;
+_AT_@ -132,10 +133,16 @@ static unsigned int defaultunderline = 7;
  
  /* Internal mouse shortcuts. */
  /* Beware that overloading Button1 will disable the selection. */
_AT_@ -30,7 +30,7 @@ index 930e468..0601fe5 100644
  };
  
  /* Internal keyboard shortcuts. */
-_AT_@ -145,6 +152,8 @@ static Shortcut shortcuts[] = {
+_AT_@ -155,6 +162,8 @@ static Shortcut shortcuts[] = {
          { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
          { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} },
          { MODKEY, XK_Num_Lock, numlock, {.i = 0} },
_AT_@ -40,10 +40,10 @@ index 930e468..0601fe5 100644
  
  /*
 diff --git a/st.c b/st.c
-index 35a840b..bb97783 100644
+index bd8b815..7a35166 100644
 --- a/st.c
 +++ b/st.c
-_AT_@ -84,6 +84,8 @@ char *argv0;
+_AT_@ -85,6 +85,8 @@ char *argv0;
  #define TRUERED(x) (((x) & 0xff0000) >> 8)
  #define TRUEGREEN(x) (((x) & 0xff00))
  #define TRUEBLUE(x) (((x) & 0xff) << 8)
_AT_@ -52,7 +52,7 @@ index 35a840b..bb97783 100644
  
  
  enum glyph_attribute {
-_AT_@ -232,6 +234,9 @@ typedef struct {
+_AT_@ -233,6 +235,9 @@ typedef struct {
          int col; /* nb col */
          Line *line; /* screen */
          Line *alt; /* alternate screen */
_AT_@ -62,7 +62,7 @@ index 35a840b..bb97783 100644
          int *dirty; /* dirtyness of lines */
          XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
          TCursor c; /* cursor */
-_AT_@ -316,6 +321,13 @@ typedef union {
+_AT_@ -317,6 +322,13 @@ typedef union {
  } Arg;
  
  typedef struct {
_AT_@ -76,7 +76,7 @@ index 35a840b..bb97783 100644
          uint mod;
          KeySym keysym;
          void (*func)(const Arg *);
-_AT_@ -325,6 +337,8 @@ typedef struct {
+_AT_@ -326,6 +338,8 @@ typedef struct {
  /* function definitions used in config.h */
  static void clipcopy(const Arg *);
  static void clippaste(const Arg *);
_AT_@ -85,7 +85,7 @@ index 35a840b..bb97783 100644
  static void numlock(const Arg *);
  static void selpaste(const Arg *);
  static void xzoom(const Arg *);
-_AT_@ -396,8 +410,8 @@ static void tputtab(int);
+_AT_@ -398,8 +412,8 @@ static void tputtab(int);
  static void tputc(Rune);
  static void treset(void);
  static void tresize(int, int);
_AT_@ -96,7 +96,7 @@ index 35a840b..bb97783 100644
  static void tsetattr(int *, int);
  static void tsetchar(Rune, Glyph *, int, int);
  static void tsetscroll(int, int);
-_AT_@ -727,10 +741,10 @@ tlinelen(int y)
+_AT_@ -729,10 +743,10 @@ tlinelen(int y)
  {
          int i = term.col;
  
_AT_@ -109,7 +109,7 @@ index 35a840b..bb97783 100644
                  --i;
  
          return i;
-_AT_@ -792,7 +806,7 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -794,7 +808,7 @@ selsnap(int *x, int *y, int direction)
                   * Snap around if the word wraps around at the end or
                   * beginning of a line.
                   */
_AT_@ -118,7 +118,7 @@ index 35a840b..bb97783 100644
                  prevdelim = ISDELIM(prevgp->u);
                  for (;;) {
                          newx = *x + direction;
-_AT_@ -807,14 +821,14 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -809,14 +823,14 @@ selsnap(int *x, int *y, int direction)
                                          yt = *y, xt = *x;
                                  else
                                          yt = newy, xt = newx;
_AT_@ -135,7 +135,7 @@ index 35a840b..bb97783 100644
                          delim = ISDELIM(gp->u);
                          if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
                                          || (delim && gp->u != prevgp->u)))
-_AT_@ -835,14 +849,14 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -837,14 +851,14 @@ selsnap(int *x, int *y, int direction)
                  *x = (direction < 0) ? 0 : term.col - 1;
                  if (direction < 0) {
                          for (; *y > 0; *y += direction) {
_AT_@ -152,7 +152,7 @@ index 35a840b..bb97783 100644
                                                  & ATTR_WRAP)) {
                                          break;
                                  }
-_AT_@ -942,13 +956,14 @@ bpress(XEvent *e)
+_AT_@ -944,13 +958,14 @@ bpress(XEvent *e)
  {
          struct timespec now;
          Mousekey *mk;
_AT_@ -168,7 +168,7 @@ index 35a840b..bb97783 100644
                  if (e->xbutton.button == mk->b
                                  && match(mk->mask, e->xbutton.state)) {
                          ttysend(mk->s, strlen(mk->s));
-_AT_@ -956,6 +971,14 @@ bpress(XEvent *e)
+_AT_@ -958,6 +973,14 @@ bpress(XEvent *e)
                  }
          }
  
_AT_@ -183,8 +183,8 @@ index 35a840b..bb97783 100644
          if (e->xbutton.button == Button1) {
                  clock_gettime(CLOCK_MONOTONIC, &now);
  
-_AT_@ -1005,13 +1028,13 @@ getsel(void)
- linelen = tlinelen(y);
+_AT_@ -1010,13 +1033,13 @@ getsel(void)
+ }
  
                  if (sel.type == SEL_RECTANGULAR) {
 - gp = &term.line[y][sel.nb.x];
_AT_@ -200,7 +200,7 @@ index 35a840b..bb97783 100644
                  while (last >= gp && last->u == ' ')
                          --last;
  
-_AT_@ -1484,6 +1507,8 @@ ttyread(void)
+_AT_@ -1489,6 +1512,8 @@ ttyread(void)
  
          /* keep any uncomplete utf8 char for the next call */
          memmove(buf, ptr, buflen);
_AT_@ -209,7 +209,7 @@ index 35a840b..bb97783 100644
  }
  
  void
-_AT_@ -1492,6 +1517,9 @@ ttywrite(const char *s, size_t n)
+_AT_@ -1497,6 +1522,9 @@ ttywrite(const char *s, size_t n)
          fd_set wfd;
          struct timespec tv;
          ssize_t r;
_AT_@ -219,7 +219,7 @@ index 35a840b..bb97783 100644
  
          /*
           * Remember that we are using a pty, which might be a modem line.
-_AT_@ -1682,13 +1710,53 @@ tswapscreen(void)
+_AT_@ -1688,13 +1716,53 @@ tswapscreen(void)
  }
  
  void
_AT_@ -274,7 +274,7 @@ index 35a840b..bb97783 100644
          tsetdirt(orig, term.bot-n);
          tclearregion(0, term.bot-n+1, term.col-1, term.bot);
  
-_AT_@ -1702,13 +1770,20 @@ tscrolldown(int orig, int n)
+_AT_@ -1708,13 +1776,20 @@ tscrolldown(int orig, int n)
  }
  
  void
_AT_@ -296,7 +296,7 @@ index 35a840b..bb97783 100644
          tclearregion(0, orig, term.col-1, orig+n-1);
          tsetdirt(orig+n, term.bot);
  
-_AT_@ -1757,7 +1832,7 @@ tnewline(int first_col)
+_AT_@ -1763,7 +1838,7 @@ tnewline(int first_col)
          int y = term.c.y;
  
          if (y == term.bot) {
_AT_@ -305,7 +305,7 @@ index 35a840b..bb97783 100644
          } else {
                  y++;
          }
-_AT_@ -1922,14 +1997,14 @@ void
+_AT_@ -1928,14 +2003,14 @@ void
  tinsertblankline(int n)
  {
          if (BETWEEN(term.c.y, term.top, term.bot))
_AT_@ -322,7 +322,7 @@ index 35a840b..bb97783 100644
  }
  
  int32_t
-_AT_@ -2363,11 +2438,11 @@ csihandle(void)
+_AT_@ -2369,11 +2444,11 @@ csihandle(void)
                  break;
          case 'S': /* SU -- Scroll <n> line up */
                  DEFAULT(csiescseq.arg[0], 1);
_AT_@ -336,7 +336,7 @@ index 35a840b..bb97783 100644
                  break;
          case 'L': /* IL -- Insert <n> blank lines */
                  DEFAULT(csiescseq.arg[0], 1);
-_AT_@ -2837,7 +2912,7 @@ eschandle(uchar ascii)
+_AT_@ -2869,7 +2944,7 @@ eschandle(uchar ascii)
                  return 0;
          case 'D': /* IND -- Linefeed */
                  if (term.c.y == term.bot) {
_AT_@ -345,7 +345,7 @@ index 35a840b..bb97783 100644
                  } else {
                          tmoveto(term.c.x, term.c.y+1);
                  }
-_AT_@ -2850,7 +2925,7 @@ eschandle(uchar ascii)
+_AT_@ -2882,7 +2957,7 @@ eschandle(uchar ascii)
                  break;
          case 'M': /* RI -- Reverse index */
                  if (term.c.y == term.top) {
_AT_@ -354,7 +354,7 @@ index 35a840b..bb97783 100644
                  } else {
                          tmoveto(term.c.x, term.c.y-1);
                  }
-_AT_@ -3013,7 +3088,7 @@ tputc(Rune u)
+_AT_@ -3045,7 +3120,7 @@ tputc(Rune u)
  void
  tresize(int col, int row)
  {
_AT_@ -363,7 +363,7 @@ index 35a840b..bb97783 100644
          int minrow = MIN(row, term.row);
          int mincol = MIN(col, term.col);
          int *bp;
-_AT_@ -3050,9 +3125,18 @@ tresize(int col, int row)
+_AT_@ -3082,9 +3157,18 @@ tresize(int col, int row)
          /* resize to new height */
          term.line = xrealloc(term.line, row * sizeof(Line));
          term.alt = xrealloc(term.alt, row * sizeof(Line));
_AT_@ -382,7 +382,7 @@ index 35a840b..bb97783 100644
          /* resize each row to new width, zero-pad if needed */
          for (i = 0; i < minrow; i++) {
                  term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
-_AT_@ -3924,11 +4008,11 @@ drawregion(int x1, int y1, int x2, int y2)
+_AT_@ -3956,11 +4040,11 @@ drawregion(int x1, int y1, int x2, int y2)
                  term.dirty[y] = 0;
  
                  specs = term.specbuf;
_AT_@ -396,7 +396,7 @@ index 35a840b..bb97783 100644
                          if (new.mode == ATTR_WDUMMY)
                                  continue;
                          if (ena_sel && selected(x, y))
-_AT_@ -3948,7 +4032,8 @@ drawregion(int x1, int y1, int x2, int y2)
+_AT_@ -3980,7 +4064,8 @@ drawregion(int x1, int y1, int x2, int y2)
                  if (i > 0)
                          xdrawglyphfontspecs(specs, base, i, ox, y);
          }
Received on Wed Sep 16 2015 - 16:55:16 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 16 2015 - 17:00:13 CEST