all repos — st @ 0e738c3d7291675472380a25b74f0358306541e5

st (suckless terminal) config

Style inquisition.
Christoph Lohmann 20h@r-36.net
commit

0e738c3d7291675472380a25b74f0358306541e5

parent

7f297e297ccec99a66b7af46e2b1725545ba3746

1 files changed, 22 insertions(+), 22 deletions(-)

jump to
M st.cst.c

@@ -1662,7 +1662,7 @@ DEFAULT(csiescseq.arg[0], 1);

tmoveto(0, term.c.y-csiescseq.arg[0]); break; case 'g': /* TBC -- Tabulation clear */ - switch (csiescseq.arg[0]) { + switch(csiescseq.arg[0]) { case 0: /* clear current tab stop */ term.tabs[term.c.x] = 0; break;

@@ -1927,7 +1927,7 @@

if(c == '\033') { /* escape */ tputc("^", 1); tputc("[", 1); - } else if (c < '\x20') { /* control code */ + } else if(c < '\x20') { /* control code */ if(c != '\n' && c != '\r' && c != '\t') { c |= '\x40'; tputc("^", 1);

@@ -1937,7 +1937,7 @@ } else {

break; } } - if (len) + if(len) tputc(buf, len); }

@@ -1947,7 +1947,7 @@ uchar ascii = *c;

bool control = ascii < '\x20' || ascii == 0177; if(iofd != -1) { - if (xwrite(iofd, c, len) < 0) { + if(xwrite(iofd, c, len) < 0) { fprintf(stderr, "Error writing in %s:%s\n", opt_io, strerror(errno)); close(iofd);

@@ -2471,8 +2471,8 @@ /*

* Free the loaded fonts in the font cache. This is done backwards * from the frccur. */ - for (i = 0, ip = frccur; i < frclen; i++, ip--) { - if (ip < 0) + for(i = 0, ip = frccur; i < frclen; i++, ip--) { + if(ip < 0) ip = LEN(frc) - 1; XftFontClose(xw.dpy, frc[ip].font); }

@@ -2515,7 +2515,7 @@ xw.scr = XDefaultScreen(xw.dpy);

xw.vis = XDefaultVisual(xw.dpy, xw.scr); /* font */ - if (!FcInit()) + if(!FcInit()) die("Could not init fontconfig.\n"); usedfont = (opt_font == NULL)? font : opt_font;

@@ -2718,7 +2718,7 @@ /* Clean up the region we want to draw to. */

XftDrawRect(xw.draw, bg, winx, winy, width, xw.ch); fcsets[0] = font->set; - for (xp = winx; bytelen > 0;) { + for(xp = winx; bytelen > 0;) { /* * Search for the range in the to be printed string of glyphs * that are in the main font. Then print that range. If

@@ -2728,22 +2728,22 @@ */

u8fs = s; u8fblen = 0; u8fl = 0; - for (;;) { + for(;;) { u8c = s; u8cblen = utf8decode(s, &u8char); s += u8cblen; bytelen -= u8cblen; doesexist = XftCharIndex(xw.dpy, font->match, u8char); - if (!doesexist || bytelen <= 0) { - if (bytelen <= 0) { - if (doesexist) { + if(!doesexist || bytelen <= 0) { + if(bytelen <= 0) { + if(doesexist) { u8fl++; u8fblen += u8cblen; } } - if (u8fl > 0) { + if(u8fl > 0) { XftDrawStringUtf8(xw.draw, fg, font->match, xp, winy + font->ascent,

@@ -2757,23 +2757,23 @@

u8fl++; u8fblen += u8cblen; } - if (doesexist) + if(doesexist) break; frp = frccur; /* Search the font cache. */ - for (i = 0; i < frclen; i++, frp--) { - if (frp <= 0) + for(i = 0; i < frclen; i++, frp--) { + if(frp <= 0) frp = LEN(frc) - 1; - if (frc[frp].c == u8char + if(frc[frp].c == u8char && frc[frp].flags == frcflags) { break; } } /* Nothing was found. */ - if (i >= frclen) { + if(i >= frclen) { /* * Nothing was found in the cache. Now use * some dozen of Fontconfig calls to get the

@@ -2801,9 +2801,9 @@ * entry.

*/ frccur++; frclen++; - if (frccur >= LEN(frc)) + if(frccur >= LEN(frc)) frccur = 0; - if (frclen > LEN(frc)) { + if(frclen > LEN(frc)) { frclen = LEN(frc); XftFontClose(xw.dpy, frc[frccur].font); }

@@ -3085,7 +3085,7 @@ int len;

Status status; Shortcut *bp; - if (IS_SET(MODE_KBDLOCK)) + if(IS_SET(MODE_KBDLOCK)) return; len = XmbLookupString(xw.xic, e, xstr, sizeof(xstr), &ksym, &status);

@@ -3107,7 +3107,7 @@ } else {

if(len == 0) return; - if (len == 1 && e->state & Mod1Mask) + if(len == 1 && e->state & Mod1Mask) *cp++ = '\033'; memcpy(cp, xstr, len);