commit 3b684f5
Emilia Smólska
·
2026-09-12 20:17:15 +0000 UTC
parent 9920b89
style
1 files changed,
+2,
-2
M
wc.lua
M
wc.lua
+2,
-2
1@@ -613,12 +613,12 @@ function wc.width(ucs)
2 if ucs < 32
3 or (ucs >= 0x7F and ucs <= 0x9F)
4 or (ucs >= 0xD800 and ucs <= 0xDFFF)
5- then error("invalid character") end
6+ then error "invalid character" end
7 if ucs == 0xAD then return 0 end -- force unicode behaviour for soft hyphen
8 -- XXX: these pairs of tables could be merged but i cba to
9 if lookup(ucs, formatting) or lookup(ucs, combining) then return 0 end
10 if lookup(ucs, doublewidth) or lookup(ucs, emoji_chars) then return 2 end
11- if lookup(ucs, unknowns) then error("invalid character") end
12+ if lookup(ucs, unknowns) then error "invalid character" end
13 return 1
14 end
15