X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=aaf868d84ca783a10040b0f15de590f227a8cf86;hb=0c94f8621b738c51c9e08abc3c52fe8dfe24b953;hp=1df4fde1cbd927be170fabfcfd9d6e48e2960eac;hpb=ee5cad439b427fa974903a6f0bb2689d11119d89;p=st.git diff --git a/st.c b/st.c index 1df4fde..aaf868d 100644 --- a/st.c +++ b/st.c @@ -1531,7 +1531,8 @@ ttywrite(const char *s, size_t n) * This means the buffer is getting full * again. Empty it. */ - ttyread(); + if (n < 256) + ttyread(); n -= r; s += r; } else { @@ -2895,15 +2896,15 @@ tputc(Rune u) int width, len; Glyph *gp; + control = ISCONTROL(u); len = utf8encode(u, c); - if ((width = wcwidth(u)) == -1) { + if (!control && (width = wcwidth(u)) == -1) { memcpy(c, "\357\277\275", 4); /* UTF_INVALID */ width = 1; } if (IS_SET(MODE_PRINT)) tprinter(c, len); - control = ISCONTROL(u); /* * STR sequence must be checked before anything else