pinosaur
/
st.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8211e36
)
optimize column width calculation and utf-8 encode for ASCII
author
Hiltjo Posthuma
<hiltjo@codemadness.org>
Sat, 9 May 2020 12:03:14 +0000
(14:03 +0200)
committer
Hiltjo Posthuma
<hiltjo@codemadness.org>
Sat, 9 May 2020 12:11:25 +0000
(14:11 +0200)
In particular on OpenBSD and on glibc wcwidth() is quite expensive.
On musl there is little difference.
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
5d4054f
..
1414f98
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-2307,7
+2307,7
@@
tputc(Rune u)
Glyph *gp;
control = ISCONTROL(u);
- if (!IS_SET(MODE_UTF8 | MODE_SIXEL)) {
+ if (
u < 127 ||
!IS_SET(MODE_UTF8 | MODE_SIXEL)) {
c[0] = u;
width = len = 1;
} else {