[wiki] [sites] st: update scrollback patch for current git (ae1923d) || Jochen Sprickerhof
commit 2bbd9885fc6b4fa453ca08fb6ff4f9df78b0bd24
Author: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
Date: Thu May 7 13:57:38 2015 +0200
st: update scrollback patch for current git (ae1923d)
diff --git a/st.suckless.org/patches/st-scrollback.diff b/st.suckless.org/patches/st-scrollback.diff
index 621c00f..b3f15f1 100644
--- a/st.suckless.org/patches/st-scrollback.diff
+++ b/st.suckless.org/patches/st-scrollback.diff
_AT_@ -20,10 +20,10 @@ index bb5596e..2df4cbc 100644
/*
diff --git a/st.c b/st.c
-index d954288..0102094 100644
+index c2da66b..f561654 100644
--- a/st.c
+++ b/st.c
-_AT_@ -84,6 +84,8 @@ char *argv0;
+_AT_@ -83,6 +83,8 @@ char *argv0;
#define TRUERED(x) (((x) & 0xff0000) >> 8)
#define TRUEGREEN(x) (((x) & 0xff00))
#define TRUEBLUE(x) (((x) & 0xff) << 8)
_AT_@ -32,7 +32,7 @@ index d954288..0102094 100644
enum glyph_attribute {
-_AT_@ -223,6 +225,9 @@ typedef struct {
+_AT_@ -231,6 +233,9 @@ typedef struct {
int col; /* nb col */
Line *line; /* screen */
Line *alt; /* alternate screen */
_AT_@ -40,9 +40,9 @@ index d954288..0102094 100644
+ int histi; /* history index */
+ int scr; /* scroll back */
bool *dirty; /* dirtyness of lines */
+ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
TCursor c; /* cursor */
- int top; /* top scroll limit */
-_AT_@ -315,6 +320,8 @@ typedef struct {
+_AT_@ -324,6 +329,8 @@ typedef struct {
/* function definitions used in config.h */
static void clipcopy(const Arg *);
static void clippaste(const Arg *);
_AT_@ -51,8 +51,8 @@ index d954288..0102094 100644
static void numlock(const Arg *);
static void selpaste(const Arg *);
static void xzoom(const Arg *);
-_AT_@ -386,8 +393,8 @@ static void tputtab(int);
- static void tputc(long);
+_AT_@ -395,8 +402,8 @@ static void tputtab(int);
+ static void tputc(Rune);
static void treset(void);
static void tresize(int, int);
-static void tscrollup(int, int);
_AT_@ -60,9 +60,9 @@ index d954288..0102094 100644
+static void tscrollup(int, int, bool);
+static void tscrolldown(int, int, bool);
static void tsetattr(int *, int);
- static void tsetchar(long, Glyph *, int, int);
+ static void tsetchar(Rune, Glyph *, int, int);
static void tsetscroll(int, int);
-_AT_@ -672,10 +679,10 @@ int
+_AT_@ -682,10 +689,10 @@ int
tlinelen(int y) {
int i = term.col;
_AT_@ -75,7 +75,7 @@ index d954288..0102094 100644
--i;
return i;
-_AT_@ -731,7 +738,7 @@ selsnap(int mode, int *x, int *y, int direction) {
+_AT_@ -744,7 +751,7 @@ selsnap(int *x, int *y, int direction) {
* Snap around if the word wraps around at the end or
* beginning of a line.
*/
_AT_@ -84,7 +84,7 @@ index d954288..0102094 100644
prevdelim = ISDELIM(prevgp->u);
for(;;) {
newx = *x + direction;
-_AT_@ -746,14 +753,14 @@ selsnap(int mode, int *x, int *y, int direction) {
+_AT_@ -759,14 +766,14 @@ selsnap(int *x, int *y, int direction) {
yt = *y, xt = *x;
else
yt = newy, xt = newx;
_AT_@ -101,9 +101,9 @@ index d954288..0102094 100644
delim = ISDELIM(gp->u);
if(!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|| (delim && gp->u != prevgp->u)))
-_AT_@ -774,14 +781,14 @@ selsnap(int mode, int *x, int *y, int direction) {
+_AT_@ -787,14 +794,14 @@ selsnap(int *x, int *y, int direction) {
*x = (direction < 0) ? 0 : term.col - 1;
- if(direction < 0 && *y > 0) {
+ if(direction < 0) {
for(; *y > 0; *y += direction) {
- if(!(term.line[*y-1][term.col-1].mode
+ if(!(TLINE(*y-1)[term.col-1].mode
_AT_@ -111,14 +111,14 @@ index d954288..0102094 100644
break;
}
}
- } else if(direction > 0 && *y < term.row-1) {
- for(; *y < term.row; *y += direction) {
+ } else if(direction > 0) {
+ for(; *y < term.row-1; *y += direction) {
- if(!(term.line[*y][term.col-1].mode
+ if(!(TLINE(*y)[term.col-1].mode
& ATTR_WRAP)) {
break;
}
-_AT_@ -945,13 +952,13 @@ getsel(void) {
+_AT_@ -953,13 +960,13 @@ getsel(void) {
linelen = tlinelen(y);
if(sel.type == SEL_RECTANGULAR) {
_AT_@ -135,7 +135,7 @@ index d954288..0102094 100644
while(last >= gp && last->u == ' ')
--last;
-_AT_@ -1350,10 +1357,16 @@ ttyread(void) {
+_AT_@ -1361,10 +1368,16 @@ ttyread(void) {
/* keep any uncomplete utf8 char for the next call */
memmove(buf, ptr, buflen);
_AT_@ -152,7 +152,7 @@ index d954288..0102094 100644
if(xwrite(cmdfd, s, n) == -1)
die("write error on tty: %s
", strerror(errno));
}
-_AT_@ -1488,13 +1501,52 @@ tswapscreen(void) {
+_AT_@ -1499,13 +1512,52 @@ tswapscreen(void) {
}
void
_AT_@ -206,7 +206,7 @@ index d954288..0102094 100644
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
for(i = term.bot; i >= orig+n; i--) {
-_AT_@ -1507,12 +1559,19 @@ tscrolldown(int orig, int n) {
+_AT_@ -1518,12 +1570,19 @@ tscrolldown(int orig, int n) {
}
void
_AT_@ -227,7 +227,7 @@ index d954288..0102094 100644
tclearregion(0, orig, term.col-1, orig+n-1);
tsetdirt(orig+n, term.bot);
-_AT_@ -1559,7 +1618,7 @@ tnewline(int first_col) {
+_AT_@ -1570,7 +1629,7 @@ tnewline(int first_col) {
int y = term.c.y;
if(y == term.bot) {
_AT_@ -236,7 +236,7 @@ index d954288..0102094 100644
} else {
y++;
}
-_AT_@ -1716,13 +1775,13 @@ tinsertblank(int n) {
+_AT_@ -1727,13 +1786,13 @@ tinsertblank(int n) {
void
tinsertblankline(int n) {
if(BETWEEN(term.c.y, term.top, term.bot))
_AT_@ -252,7 +252,7 @@ index d954288..0102094 100644
}
int32_t
-_AT_@ -2151,11 +2210,11 @@ csihandle(void) {
+_AT_@ -2162,11 +2221,11 @@ csihandle(void) {
break;
case 'S': /* SU -- Scroll <n> line up */
DEFAULT(csiescseq.arg[0], 1);
_AT_@ -266,7 +266,7 @@ index d954288..0102094 100644
break;
case 'L': /* IL -- Insert <n> blank lines */
DEFAULT(csiescseq.arg[0], 1);
-_AT_@ -2605,7 +2664,7 @@ eschandle(uchar ascii) {
+_AT_@ -2616,7 +2675,7 @@ eschandle(uchar ascii) {
return 0;
case 'D': /* IND -- Linefeed */
if(term.c.y == term.bot) {
_AT_@ -275,7 +275,7 @@ index d954288..0102094 100644
} else {
tmoveto(term.c.x, term.c.y+1);
}
-_AT_@ -2618,7 +2677,7 @@ eschandle(uchar ascii) {
+_AT_@ -2629,7 +2688,7 @@ eschandle(uchar ascii) {
break;
case 'M': /* RI -- Reverse index */
if(term.c.y == term.top) {
_AT_@ -284,7 +284,7 @@ index d954288..0102094 100644
} else {
tmoveto(term.c.x, term.c.y-1);
}
-_AT_@ -2779,7 +2838,7 @@ tputc(long u) {
+_AT_@ -2790,7 +2849,7 @@ tputc(Rune u) {
void
tresize(int col, int row) {
_AT_@ -293,7 +293,7 @@ index d954288..0102094 100644
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
bool *bp;
-_AT_@ -2813,9 +2872,18 @@ tresize(int col, int row) {
+_AT_@ -2827,9 +2886,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_@ -312,22 +312,23 @@ index d954288..0102094 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_@ -3663,10 +3731,10 @@ drawregion(int x1, int y1, int x2, int y2) {
-
- xtermclear(0, y, term.col, y);
+_AT_@ -3663,11 +3731,11 @@ drawregion(int x1, int y1, int x2, int y2) {
term.dirty[y] = 0;
-- base = term.line[y][0];
-+ base = TLINE(y)[0];
- ic = ib = ox = 0;
- for(x = x1; x < x2; x++) {
+
+ specs = term.specbuf;
+- numspecs = xmakeglyphfontspecs(specs, &term.line[y][0], x2 - x1, x1, y);
++ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[0], x2 - x1, x1, y);
+
+ i = ox = 0;
+ for(x = x1; x < x2 && i < numspecs; x++) {
- new = term.line[y][x];
+ new = TLINE(y)[x];
if(new.mode == ATTR_WDUMMY)
continue;
if(ena_sel && selected(x, y))
_AT_@ -3687,7 +3755,8 @@ drawregion(int x1, int y1, int x2, int y2) {
- if(ib > 0)
- xdraws(buf, base, ox, y, ic, ib);
+ if(i > 0)
+ xdrawglyphfontspecs(specs, base, i, ox, y);
}
- xdrawcursor();
+ if(term.scr == 0)
Received on Thu May 07 2015 - 13:58:02 CEST
This archive was generated by hypermail 2.3.0
: Thu Jun 18 2015 - 17:40:20 CEST