[wiki] [sites] [st][scrollback] Update for latest git || Jochen Sprickerhof
commit 8ad55be75a15c63b7bbb0057593172ae56abf3e9
Author: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
Date: Sun Apr 5 12:49:49 2020 +0200
[st][scrollback] Update for latest git
diff --git a/st.suckless.org/patches/scrollback/index.md b/st.suckless.org/patches/scrollback/index.md
index d8053f3b..5513edf0 100644
--- a/st.suckless.org/patches/scrollback/index.md
+++ b/st.suckless.org/patches/scrollback/index.md
_AT_@ -11,7 +11,7 @@ Download
* [st-scrollback-0.8.diff](st-scrollback-0.8.diff)
* [st-scrollback-0.8.1.diff](st-scrollback-0.8.1.diff)
* [st-scrollback-0.8.2.diff](st-scrollback-0.8.2.diff)
-* [st-scrollback-20190331-21367a0.diff](st-scrollback-20190331-21367a0.diff)
+* [st-scrollback-20200504-28ad288.diff](st-scrollback-20200504-28ad288.diff)
Apply the following patch on top of the previous to allow scrolling
using `Shift+MouseWheel`.
diff --git a/st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff b/st.suckless.org/patches/scrollback/st-scrollback-20200504-28ad288.diff
similarity index 85%
rename from st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff
rename to st.suckless.org/patches/scrollback/st-scrollback-20200504-28ad288.diff
index 3abdecef..55a02d3f 100644
--- a/st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff
+++ b/st.suckless.org/patches/scrollback/st-scrollback-20200504-28ad288.diff
_AT_@ -1,8 +1,8 @@
diff --git a/config.def.h b/config.def.h
-index 482901e..5352f43 100644
+index 546edda..ec1b576 100644
--- a/config.def.h
+++ b/config.def.h
-_AT_@ -178,6 +178,8 @@ static Shortcut shortcuts[] = {
+_AT_@ -186,6 +186,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
_AT_@ -12,7 +12,7 @@ index 482901e..5352f43 100644
/*
diff --git a/st.c b/st.c
-index 8e6ccb5..2599333 100644
+index 3e48410..f8b6f67 100644
--- a/st.c
+++ b/st.c
_AT_@ -35,6 +35,7 @@
_AT_@ -43,7 +43,7 @@ index 8e6ccb5..2599333 100644
int *dirty; /* dirtyness of lines */
TCursor c; /* cursor */
int ocx; /* old cursor col */
-_AT_@ -184,8 +191,8 @@ static void tnewline(int);
+_AT_@ -185,8 +192,8 @@ static void tnewline(int);
static void tputtab(int);
static void tputc(Rune);
static void treset(void);
_AT_@ -54,7 +54,7 @@ index 8e6ccb5..2599333 100644
static void tsetattr(int *, int);
static void tsetchar(Rune, Glyph *, int, int);
static void tsetdirt(int, int);
-_AT_@ -409,10 +416,10 @@ tlinelen(int y)
+_AT_@ -414,10 +421,10 @@ tlinelen(int y)
{
int i = term.col;
_AT_@ -67,7 +67,7 @@ index 8e6ccb5..2599333 100644
--i;
return i;
-_AT_@ -521,7 +528,7 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -526,7 +533,7 @@ selsnap(int *x, int *y, int direction)
* Snap around if the word wraps around at the end or
* beginning of a line.
*/
_AT_@ -76,7 +76,7 @@ index 8e6ccb5..2599333 100644
prevdelim = ISDELIM(prevgp->u);
for (;;) {
newx = *x + direction;
-_AT_@ -536,14 +543,14 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -541,14 +548,14 @@ selsnap(int *x, int *y, int direction)
yt = *y, xt = *x;
else
yt = newy, xt = newx;
_AT_@ -93,7 +93,7 @@ index 8e6ccb5..2599333 100644
delim = ISDELIM(gp->u);
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|| (delim && gp->u != prevgp->u)))
-_AT_@ -564,14 +571,14 @@ selsnap(int *x, int *y, int direction)
+_AT_@ -569,14 +576,14 @@ selsnap(int *x, int *y, int direction)
*x = (direction < 0) ? 0 : term.col - 1;
if (direction < 0) {
for (; *y > 0; *y += direction) {
_AT_@ -110,7 +110,7 @@ index 8e6ccb5..2599333 100644
& ATTR_WRAP)) {
break;
}
-_AT_@ -602,13 +609,13 @@ getsel(void)
+_AT_@ -607,13 +614,13 @@ getsel(void)
}
if (sel.type == SEL_RECTANGULAR) {
_AT_@ -127,7 +127,7 @@ index 8e6ccb5..2599333 100644
while (last >= gp && last->u == ' ')
--last;
-_AT_@ -831,6 +838,9 @@ void
+_AT_@ -836,6 +843,9 @@ void
ttywrite(const char *s, size_t n, int may_echo)
{
const char *next;
_AT_@ -137,7 +137,7 @@ index 8e6ccb5..2599333 100644
if (may_echo && IS_SET(MODE_ECHO))
twrite(s, n, 1);
-_AT_@ -1042,13 +1052,53 @@ tswapscreen(void)
+_AT_@ -1047,13 +1057,53 @@ tswapscreen(void)
}
void
_AT_@ -192,7 +192,13 @@ index 8e6ccb5..2599333 100644
tsetdirt(orig, term.bot-n);
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
-_AT_@ -1062,13 +1112,23 @@ tscrolldown(int orig, int n)
+_AT_@ -1063,17 +1113,28 @@ tscrolldown(int orig, int n)
+ term.line[i-n] = temp;
+ }
+
+- selscroll(orig, n);
++ if (term.scr == 0)
++ selscroll(orig, n);
}
void
_AT_@ -217,7 +223,17 @@ index 8e6ccb5..2599333 100644
tclearregion(0, orig, term.col-1, orig+n-1);
tsetdirt(orig+n, term.bot);
-_AT_@ -1117,7 +1177,7 @@ tnewline(int first_col)
+_AT_@ -1083,7 +1144,8 @@ tscrollup(int orig, int n)
+ term.line[i+n] = temp;
+ }
+
+- selscroll(orig, -n);
++ if (term.scr == 0)
++ selscroll(orig, -n);
+ }
+
+ void
+_AT_@ -1122,7 +1184,7 @@ tnewline(int first_col)
int y = term.c.y;
if (y == term.bot) {
_AT_@ -226,7 +242,7 @@ index 8e6ccb5..2599333 100644
} else {
y++;
}
-_AT_@ -1282,14 +1342,14 @@ void
+_AT_@ -1287,14 +1349,14 @@ void
tinsertblankline(int n)
{
if (BETWEEN(term.c.y, term.top, term.bot))
_AT_@ -243,7 +259,7 @@ index 8e6ccb5..2599333 100644
}
int32_t
-_AT_@ -1720,11 +1780,11 @@ csihandle(void)
+_AT_@ -1725,11 +1787,11 @@ csihandle(void)
break;
case 'S': /* SU -- Scroll <n> line up */
DEFAULT(csiescseq.arg[0], 1);
_AT_@ -257,7 +273,7 @@ index 8e6ccb5..2599333 100644
break;
case 'L': /* IL -- Insert <n> blank lines */
DEFAULT(csiescseq.arg[0], 1);
-_AT_@ -2227,7 +2287,7 @@ eschandle(uchar ascii)
+_AT_@ -2235,7 +2297,7 @@ eschandle(uchar ascii)
return 0;
case 'D': /* IND -- Linefeed */
if (term.c.y == term.bot) {
_AT_@ -266,7 +282,7 @@ index 8e6ccb5..2599333 100644
} else {
tmoveto(term.c.x, term.c.y+1);
}
-_AT_@ -2240,7 +2300,7 @@ eschandle(uchar ascii)
+_AT_@ -2248,7 +2310,7 @@ eschandle(uchar ascii)
break;
case 'M': /* RI -- Reverse index */
if (term.c.y == term.top) {
_AT_@ -275,7 +291,7 @@ index 8e6ccb5..2599333 100644
} else {
tmoveto(term.c.x, term.c.y-1);
}
-_AT_@ -2458,7 +2518,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
+_AT_@ -2469,7 +2531,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
void
tresize(int col, int row)
{
_AT_@ -284,7 +300,7 @@ index 8e6ccb5..2599333 100644
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
int *bp;
-_AT_@ -2495,6 +2555,14 @@ tresize(int col, int row)
+_AT_@ -2506,6 +2568,14 @@ tresize(int col, int row)
term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
_AT_@ -299,7 +315,7 @@ index 8e6ccb5..2599333 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_@ -2552,7 +2620,7 @@ drawregion(int x1, int y1, int x2, int y2)
+_AT_@ -2563,7 +2633,7 @@ drawregion(int x1, int y1, int x2, int y2)
continue;
term.dirty[y] = 0;
_AT_@ -308,7 +324,7 @@ index 8e6ccb5..2599333 100644
}
}
-_AT_@ -2573,8 +2641,9 @@ draw(void)
+_AT_@ -2584,8 +2654,9 @@ draw(void)
cx--;
drawregion(0, 0, term.col, term.row);
_AT_@ -321,10 +337,10 @@ index 8e6ccb5..2599333 100644
xfinishdraw();
xximspot(term.ocx, term.ocy);
diff --git a/st.h b/st.h
-index 4da3051..f11685d 100644
+index a1928ca..1332cf1 100644
--- a/st.h
+++ b/st.h
-_AT_@ -80,6 +80,8 @@ void die(const char *, ...);
+_AT_@ -81,6 +81,8 @@ void die(const char *, ...);
void redraw(void);
void draw(void);
Received on Sun Apr 05 2020 - 13:24:12 CEST
This archive was generated by hypermail 2.3.0
: Sun Apr 05 2020 - 13:24:49 CEST