summaryrefslogtreecommitdiff
path: root/lib/std/fmt.myr
diff options
context:
space:
mode:
authorS. Gilles <sgilles@math.umd.edu>2017-10-29 00:51:25 -0400
committerOri Bernstein <ori@eigenstate.org>2017-10-29 19:46:03 -0700
commitdde43f18e3b9f699c188c74064cf785917b41e22 (patch)
tree7f3c9863634a948a3a5047eb7e5deea6331d48a7 /lib/std/fmt.myr
parent4ecfdbc4819481740991e7f477a32ed7396c7125 (diff)
downloadmc-dde43f18e3b9f699c188c74064cf785917b41e22.tar.gz
Implement graphemewidth
Diffstat (limited to 'lib/std/fmt.myr')
-rw-r--r--lib/std/fmt.myr10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/std/fmt.myr b/lib/std/fmt.myr
index 08b814d..1f542d3 100644
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -553,7 +553,7 @@ const strfmt = {sb, str, params
;;
;;
else
- for i = 0; i < w - graphemewidth(str); i++
+ for i = 0; i < w - strcellwidth(str); i++
sbputc(sb, p)
;;
sbputs(sb, str)
@@ -564,14 +564,6 @@ const isprint = {b
-> b >= (' ' : byte) && b < ('~' : byte)
}
-/*
-Hah. like we're going to put in the work to actually
-count graphemes.
-*/
-const graphemewidth = {str
- -> str.len
-}
-
const digitchars = [
'0','1','2','3','4',
'5','6','7','8','9',