Compare commits

..

No commits in common. "b8f883325d10f775d975b6c222072ae394f631b2" and "b980da555f0c1f498d5f944be3104b5635cea436" have entirely different histories.

6 changed files with 18 additions and 39 deletions

View File

@ -7,7 +7,13 @@ include config.mk
SRC = st.c x.c hb.c
OBJ = $(SRC:.c=.o)
all: st
all: options st
options:
@echo st build options:
@echo "CFLAGS = $(STCFLAGS)"
@echo "LDFLAGS = $(STLDFLAGS)"
@echo "CC = $(CC)"
config.h:
cp config.def.h config.h
@ -49,4 +55,4 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
.PHONY: all clean dist install uninstall
.PHONY: all options clean dist install uninstall

View File

@ -59,7 +59,7 @@ int allowwindowops = 0;
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 2;
static double minlatency = 8;
static double maxlatency = 33;
/*

View File

@ -1,5 +1,5 @@
# st version
VERSION = 0.9.2
VERSION = 0.9
# Customize below to fit your system

20
st.c
View File

@ -1198,7 +1198,7 @@ tscrollup(int orig, int n, int copyhist)
void
selscroll(int orig, int n)
{
if (sel.ob.x == -1 || sel.alt != IS_SET(MODE_ALTSCREEN))
if (sel.ob.x == -1)
return;
if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) {
@ -1255,7 +1255,6 @@ csiparse(void)
{
char *p = csiescseq.buf, *np;
long int v;
int sep = ';'; /* colon or semi-colon, but not both */
csiescseq.narg = 0;
if (*p == '?') {
@ -1274,9 +1273,7 @@ csiparse(void)
csiescseq.arg[csiescseq.narg++] = v;
p = np;
readcolonargs(&p, csiescseq.narg-1, csiescseq.carg);
if (sep == ';' && *p == ':')
sep = ':'; /* allow override to colon once */
if (*p != sep || csiescseq.narg == ESC_ARG_SIZ)
if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
break;
p++;
}
@ -1793,7 +1790,7 @@ csihandle(void)
ttywrite(vtiden, strlen(vtiden), 0);
break;
case 'b': /* REP -- if last char is printable print it <n> more times */
LIMIT(csiescseq.arg[0], 1, 65535);
DEFAULT(csiescseq.arg[0], 1);
if (term.lastc)
while (csiescseq.arg[0]-- > 0)
tputc(term.lastc);
@ -1878,7 +1875,6 @@ csihandle(void)
}
break;
case 'S': /* SU -- Scroll <n> line up */
if (csiescseq.priv) break;
DEFAULT(csiescseq.arg[0], 1);
tscrollup(term.top, csiescseq.arg[0], 0);
break;
@ -2487,7 +2483,6 @@ eschandle(uchar ascii)
treset();
resettitle();
xloadcols();
xsetmode(0, MODE_HIDE);
break;
case '=': /* DECPAM -- Application keypad */
xsetmode(1, MODE_APPKEYPAD);
@ -2629,16 +2624,11 @@ check_control_code:
gp = &term.line[term.c.y][term.c.x];
}
if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) {
if (IS_SET(MODE_INSERT) && term.c.x+width < term.col)
memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph));
gp->mode &= ~ATTR_WIDE;
}
if (term.c.x+width > term.col) {
if (IS_SET(MODE_WRAP))
tnewline(1);
else
tmoveto(term.col - width, term.c.y);
tnewline(1);
gp = &term.line[term.c.y][term.c.x];
}

View File

@ -185,10 +185,6 @@ st-mono| simpleterm monocolor,
# XTerm extensions
rmxx=\E[29m,
smxx=\E[9m,
BE=\E[?2004h,
BD=\E[?2004l,
PS=\E[200~,
PE=\E[201~,
# disabled rep for now: causes some issues with older ncurses versions.
# rep=%p1%c\E[%p2%{1}%-%db,
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)

19
x.c
View File

@ -858,7 +858,7 @@ xloadcols(void)
int
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
{
if (!BETWEEN(x, 0, dc.collen - 1))
if (!BETWEEN(x, 0, dc.collen))
return 1;
*r = dc.col[x].color.red >> 8;
@ -873,7 +873,7 @@ xsetcolorname(int x, const char *name)
{
Color ncolor;
if (!BETWEEN(x, 0, dc.collen - 1))
if (!BETWEEN(x, 0, dc.collen))
return 1;
if (!xloadcolor(x, name, &ncolor))
@ -1268,8 +1268,7 @@ void
xinit(int cols, int rows)
{
XGCValues gcvalues;
Cursor cursor;
Window parent, root;
Window parent;
pid_t thispid = getpid();
XColor xmousefg, xmousebg;
XWindowAttributes attr;
@ -1322,21 +1321,15 @@ xinit(int cols, int rows)
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
xw.attrs.colormap = xw.cmap;
root = XRootWindow(xw.dpy, xw.scr);
if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
parent = XRootWindow(xw.dpy, xw.scr);
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
win.w, win.h, 0, xw.depth, InputOutput,
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
| CWEventMask | CWColormap, &xw.attrs);
if (parent != root)
XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t);
memset(&gcvalues, 0, sizeof(gcvalues));
gcvalues.graphics_exposures = False;
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
/* dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, &gcvalues); */
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
@ -2186,9 +2179,6 @@ xseticontitle(char *p)
XTextProperty prop;
DEFAULT(p, opt_title);
if (p[0] == '\0')
p = opt_title;
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
&prop) != Success)
return;
@ -2203,9 +2193,6 @@ xsettitle(char *p)
XTextProperty prop;
DEFAULT(p, opt_title);
if (p[0] == '\0')
p = opt_title;
if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
&prop) != Success)
return;