chapelure icon indicating copy to clipboard operation
chapelure copied to clipboard

What is a column?

Open sofia-m-a opened this issue 2 years ago • 1 comments

Ideally we want a binding to a good implementation C function wcswidth to determine how many columns characters takes up, because as far as I can tell, this is the closest to the standard, at least for counting columns on monospace terminals.

vty has an implementation but we probably don't want to depend on the whole thing, so either asking for that to be split out or making our own standalone library for it would be good

  • [ ] Make a wcswidth package
  • [ ] Add helper functionality to Chapelure to turn column numbers in terms of unicode codepoints (what you get from length applied to a String, basically) to proper column counts
  • [ ] Render in terms of proper column numbers. Care needs to be taken to match up the highlights, etc, properly

sofia-m-a avatar Apr 25 '22 16:04 sofia-m-a

There already seems to be https://github.com/solidsnack/wcwidth but it seems to have a few issues

sofia-m-a avatar Apr 30 '22 15:04 sofia-m-a