def width

cli@0.2.0.0 · cli.bend:1000

import cli@0.2.0.0/cli.bend as Cli
import Base

1000# Display columns, as Rust's unicode-width 0.2 counts them: each code point's
1001# own width, except that an emoji sequence is one cell 2 wide. A pictograph
1002# that a ZWJ joins, a skin tone after an emoji that takes one, and tag
1003# characters add nothing; VS16 widens a 1-wide emoji to 2.
1004def width(s: String) -> Nat:
1005  width_go(s, WidthStep{0n, EmojiNone{}}, 0n)

Uses (5)

Used by (4)