commit 5c8217316b8f2fe18fb669a223a1fabaf707b435
parent cf0ce878e0a1c6a7c2392e9b00067f2ec08f5ab7
Author: Martin Kopta <martin@kopta.eu>
Date: Wed, 16 Sep 2015 09:11:59 +0200
updated scrollback patch
Diffstat:
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/st.suckless.org/patches/st-scrollback.diff b/st.suckless.org/patches/st-scrollback.diff
@@ -1,16 +1,16 @@
diff --git a/config.def.h b/config.def.h
-index 930e468..14d94fe 100644
+index b6adc5e..c3636fc 100644
--- a/config.def.h
+++ b/config.def.h
@@ -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:
-@@ -145,6 +146,8 @@ static Shortcut shortcuts[] = {
+@@ -155,6 +156,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} },
@@ -20,10 +20,10 @@ index 930e468..14d94fe 100644
/*
diff --git a/st.c b/st.c
-index 1df4fde..91f95a8 100644
+index bd8b815..3aaeb86 100644
--- a/st.c
+++ b/st.c
-@@ -84,6 +84,8 @@ char *argv0;
+@@ -85,6 +85,8 @@ char *argv0;
#define TRUERED(x) (((x) & 0xff0000) >> 8)
#define TRUEGREEN(x) (((x) & 0xff00))
#define TRUEBLUE(x) (((x) & 0xff) << 8)
@@ -32,7 +32,7 @@ index 1df4fde..91f95a8 100644
enum glyph_attribute {
-@@ -232,6 +234,9 @@ typedef struct {
+@@ -233,6 +235,9 @@ typedef struct {
int col; /* nb col */
Line *line; /* screen */
Line *alt; /* alternate screen */
@@ -42,7 +42,7 @@ index 1df4fde..91f95a8 100644
int *dirty; /* dirtyness of lines */
XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
TCursor c; /* cursor */
-@@ -325,6 +330,8 @@ typedef struct {
+@@ -326,6 +331,8 @@ typedef struct {
/* function definitions used in config.h */
static void clipcopy(const Arg *);
static void clippaste(const Arg *);
@@ -51,7 +51,7 @@ index 1df4fde..91f95a8 100644
static void numlock(const Arg *);
static void selpaste(const Arg *);
static void xzoom(const Arg *);
-@@ -396,8 +403,8 @@ static void tputtab(int);
+@@ -398,8 +405,8 @@ static void tputtab(int);
static void tputc(Rune);
static void treset(void);
static void tresize(int, int);
@@ -62,7 +62,7 @@ index 1df4fde..91f95a8 100644
static void tsetattr(int *, int);
static void tsetchar(Rune, Glyph *, int, int);
static void tsetscroll(int, int);
-@@ -727,10 +734,10 @@ tlinelen(int y)
+@@ -729,10 +736,10 @@ tlinelen(int y)
{
int i = term.col;
@@ -75,7 +75,7 @@ index 1df4fde..91f95a8 100644
--i;
return i;
-@@ -792,7 +799,7 @@ selsnap(int *x, int *y, int direction)
+@@ -794,7 +801,7 @@ selsnap(int *x, int *y, int direction)
* Snap around if the word wraps around at the end or
* beginning of a line.
*/
@@ -84,7 +84,7 @@ index 1df4fde..91f95a8 100644
prevdelim = ISDELIM(prevgp->u);
for (;;) {
newx = *x + direction;
-@@ -807,14 +814,14 @@ selsnap(int *x, int *y, int direction)
+@@ -809,14 +816,14 @@ selsnap(int *x, int *y, int direction)
yt = *y, xt = *x;
else
yt = newy, xt = newx;
@@ -101,7 +101,7 @@ index 1df4fde..91f95a8 100644
delim = ISDELIM(gp->u);
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|| (delim && gp->u != prevgp->u)))
-@@ -835,14 +842,14 @@ selsnap(int *x, int *y, int direction)
+@@ -837,14 +844,14 @@ selsnap(int *x, int *y, int direction)
*x = (direction < 0) ? 0 : term.col - 1;
if (direction < 0) {
for (; *y > 0; *y += direction) {
@@ -118,8 +118,8 @@ index 1df4fde..91f95a8 100644
& ATTR_WRAP)) {
break;
}
-@@ -1005,13 +1012,13 @@ getsel(void)
- linelen = tlinelen(y);
+@@ -1010,13 +1017,13 @@ getsel(void)
+ }
if (sel.type == SEL_RECTANGULAR) {
- gp = &term.line[y][sel.nb.x];
@@ -135,7 +135,7 @@ index 1df4fde..91f95a8 100644
while (last >= gp && last->u == ' ')
--last;
-@@ -1484,6 +1491,8 @@ ttyread(void)
+@@ -1489,6 +1496,8 @@ ttyread(void)
/* keep any uncomplete utf8 char for the next call */
memmove(buf, ptr, buflen);
@@ -144,7 +144,7 @@ index 1df4fde..91f95a8 100644
}
void
-@@ -1492,6 +1501,9 @@ ttywrite(const char *s, size_t n)
+@@ -1497,6 +1506,9 @@ ttywrite(const char *s, size_t n)
fd_set wfd;
struct timespec tv;
ssize_t r;
@@ -154,7 +154,7 @@ index 1df4fde..91f95a8 100644
/*
* Remember that we are using a pty, which might be a modem line.
-@@ -1682,13 +1694,53 @@ tswapscreen(void)
+@@ -1688,13 +1700,53 @@ tswapscreen(void)
}
void
@@ -209,7 +209,7 @@ index 1df4fde..91f95a8 100644
tsetdirt(orig, term.bot-n);
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
-@@ -1702,13 +1754,20 @@ tscrolldown(int orig, int n)
+@@ -1708,13 +1760,20 @@ tscrolldown(int orig, int n)
}
void
@@ -231,7 +231,7 @@ index 1df4fde..91f95a8 100644
tclearregion(0, orig, term.col-1, orig+n-1);
tsetdirt(orig+n, term.bot);
-@@ -1757,7 +1816,7 @@ tnewline(int first_col)
+@@ -1763,7 +1822,7 @@ tnewline(int first_col)
int y = term.c.y;
if (y == term.bot) {
@@ -240,7 +240,7 @@ index 1df4fde..91f95a8 100644
} else {
y++;
}
-@@ -1922,14 +1981,14 @@ void
+@@ -1928,14 +1987,14 @@ void
tinsertblankline(int n)
{
if (BETWEEN(term.c.y, term.top, term.bot))
@@ -257,7 +257,7 @@ index 1df4fde..91f95a8 100644
}
int32_t
-@@ -2363,11 +2422,11 @@ csihandle(void)
+@@ -2369,11 +2428,11 @@ csihandle(void)
break;
case 'S': /* SU -- Scroll <n> line up */
DEFAULT(csiescseq.arg[0], 1);
@@ -271,7 +271,7 @@ index 1df4fde..91f95a8 100644
break;
case 'L': /* IL -- Insert <n> blank lines */
DEFAULT(csiescseq.arg[0], 1);
-@@ -2837,7 +2896,7 @@ eschandle(uchar ascii)
+@@ -2869,7 +2928,7 @@ eschandle(uchar ascii)
return 0;
case 'D': /* IND -- Linefeed */
if (term.c.y == term.bot) {
@@ -280,7 +280,7 @@ index 1df4fde..91f95a8 100644
} else {
tmoveto(term.c.x, term.c.y+1);
}
-@@ -2850,7 +2909,7 @@ eschandle(uchar ascii)
+@@ -2882,7 +2941,7 @@ eschandle(uchar ascii)
break;
case 'M': /* RI -- Reverse index */
if (term.c.y == term.top) {
@@ -289,7 +289,7 @@ index 1df4fde..91f95a8 100644
} else {
tmoveto(term.c.x, term.c.y-1);
}
-@@ -3013,7 +3072,7 @@ tputc(Rune u)
+@@ -3045,7 +3104,7 @@ tputc(Rune u)
void
tresize(int col, int row)
{
@@ -298,7 +298,7 @@ index 1df4fde..91f95a8 100644
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
int *bp;
-@@ -3050,9 +3109,18 @@ tresize(int col, int row)
+@@ -3082,9 +3141,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));
@@ -317,7 +317,7 @@ index 1df4fde..91f95a8 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));
-@@ -3924,11 +3992,11 @@ drawregion(int x1, int y1, int x2, int y2)
+@@ -3956,11 +4024,11 @@ drawregion(int x1, int y1, int x2, int y2)
term.dirty[y] = 0;
specs = term.specbuf;
@@ -331,7 +331,7 @@ index 1df4fde..91f95a8 100644
if (new.mode == ATTR_WDUMMY)
continue;
if (ena_sel && selected(x, y))
-@@ -3948,7 +4016,8 @@ drawregion(int x1, int y1, int x2, int y2)
+@@ -3980,7 +4048,8 @@ drawregion(int x1, int y1, int x2, int y2)
if (i > 0)
xdrawglyphfontspecs(specs, base, i, ox, y);
}