vty/cbits
Jonathan Daugherty 74a7c557fb Add support for custom character width table installation
This change introduces a new module,
Graphics.Vty.UnicodeWidthTable.Install, that is responsible for
installing custom unicode width tables into the process. It does so by
allocating memory to hold the table, populating the table's character
ranges with widths from the UnicodeWidthTable, and then marking the
table as ready for use. That causes future calls to 'wcwidth' to consult
the new table rather than relying on the built-in logic to compute
widths.

Note that this functionality breaks the purity of 'wcwidth': 'wcwidth'
calls made before the installation of a custom table may return
different values after the table is installed, despite 'wcwidth' being a
pure function. This choice was made deliberately to simplify the API and
is based on the observation that in practice this will probably never be
an issue.

It's also worth nothing (as is spelled out in the docs, too) that a
custom table installation can only be performed at most once per program
lifetime. Once a custom table installation is performed, it cannot be
undone and no new table can be installed. This, too, is a simplification
based on the assumption that in practice multiple tables will usually
not be required.
2020-03-02 14:05:40 -08:00
..
get_tty_erase.c Add Graphics.Vty.Config.getTtyEraseChar 2020-02-27 09:46:04 -08:00
gwinsz.c use hack from SendFile for determining Fd for handle. Use when requesting window size 2014-04-09 17:08:40 -07:00
gwinsz.h prefixed all c functions to avoid Cabal bug #944 2012-04-22 15:49:25 +02:00
mk_wcwidth.c Add support for custom character width table installation 2020-03-02 14:05:40 -08:00
set_term_timing.c derive new input loop 2014-01-21 03:50:57 -08:00