Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to get string display width #88

Closed
yongrenjie opened this issue Apr 13, 2023 · 1 comment
Closed

Figure out how to get string display width #88

yongrenjie opened this issue Apr 13, 2023 · 1 comment

Comments

@yongrenjie
Copy link
Contributor

Inside the pretty.ml module we're using String.length a lot, when we should really be using the display width of the string.

e.g.

# String.length "😄";;
- : int = 4

when it should only really be 2.

@yongrenjie
Copy link
Contributor Author

yongrenjie commented Apr 13, 2023

This is the equivalent in Haskell: https://hackage.haskell.org/package/vty-5.38/docs/Graphics-Text-Width.html (https://github.com/jtdaugherty/vty)

It's a wrapper around a C library. Now, how do we do that in Ocaml...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant