Commit Graph

223 Commits

Author SHA1 Message Date
Jonathan Daugherty
0bea225b6d Rename vty-build-table to vty-build-width-table, rename main source file 2020-03-05 08:39:16 -08:00
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
Jonathan Daugherty
e271a43a01 Add Graphics.Vty.UnicodeWidthTable.Query to build a unicode width table by querying the terminal on stdin 2020-02-27 15:58:12 -08:00
Jonathan Daugherty
60c55bae3d Add tools/BuildUnicodeTable.hs, a testing program for unicode table API 2020-02-27 15:25:30 -08:00
Jonathan Daugherty
908d189422 Add Graphics.Vty.UnicodeWidthTable.IO to read and write table files 2020-02-27 15:25:08 -08:00
Jonathan Daugherty
345c0bfa64 Add Graphics.Vty.UnicodeWidthTable.Types (data types for unicode width tables) 2020-02-27 15:00:30 -08:00
Jonathan Daugherty
bd8a18c924 Bump version, update changelog 2020-02-27 10:57:05 -08:00
Jonathan Daugherty
4362b3cb1c Add Graphics.Vty.Config.getTtyEraseChar
This commit adds getTtyEraseChar. This function queries the kernel
for the current terminal's settings to obtain the character assigned
by the "stty erase" command. The "erase" character indicates which
input character the terminal should interpret to mean "backspace" when
the terminal is in canonical input mode. Vty applications run with
canonical mode disabled, but even in those cases some users may want
their "stty erase" setting honored by Vty's input-handling so that
incoming erase characters (according to stty) result in "KBS" key events
being delivered to the application.
2020-02-27 09:46:04 -08:00
Jonathan Daugherty
0f08358bd3 Bump version, update changelog 2019-10-01 10:10:30 -07:00
Michael Schröder
dff049003a Add missing MonadFail constraints
Beginning with GHC 8.8, 'fail' is no longer part of the Monad class.
2019-09-18 16:43:43 +02:00
Jonathan Daugherty
3ce0db6a5b
Merge pull request #173 from cjenn/colornote
Clarify documentation for ANSI colors, rename rgbColor to rgbColorToColor240
2019-06-26 09:34:24 -07:00
Artyom Kazak
3caad88a19
Bump microlens bound 2019-06-20 08:52:10 +03:00
Colby Jenn
800336f789 move color documentation to separate module 2019-06-16 13:14:14 -05:00
Jonathan Daugherty
ec7b51eaa7 Bump version, update changelog 2018-11-04 07:40:46 -08:00
Jonathan Daugherty
8f32f8ea4c PictureToSpans: replace specialized lens operators with more fundamental ones
This change removes -~ and +~ definitions that can conflict with those
provided by Microlens, and which were just copies of what Microlens now
provides. Instead of using those, this change just inlines their
functionality in the right spots so that we don't have to conditionally
define or import those operators depending on the version of Microlens,
which just recently started to provide these.

This change also goes ahead and introduces an upper bound on Microlens
to avoid future issues like this.
2018-11-04 07:35:11 -08:00
Jonathan Daugherty
74a72ff59f Bump version, update changelog 2018-10-15 13:38:09 -07:00
Jonathan Daugherty
3ca08b3204 Bump version, update changelog 2018-10-14 20:01:23 -07:00
Jonathan Daugherty
53c02c6516 Bump version, update changelog 2018-09-06 12:36:11 -07:00
Eric Mertens
297a7e7327 Remove unfinished test stub
Fixes #158
2018-07-30 09:41:19 -07:00
Jonathan Daugherty
188cc1a03f
Merge pull request #157 from glguy/travis
update travis build settings
2018-07-29 12:18:47 -07:00
Eric Mertens
47c074d112 update travis build settings 2018-07-29 10:01:47 -07:00
Jonathan Daugherty
bba5f0e36f Bump version, update changelog 2018-07-28 17:54:47 -07:00
Jonathan Daugherty
181a5d77df Bump version, update changelog 2018-07-27 13:32:34 -07:00
Jonathan Daugherty
3a3d6b35a0 Bump version, update changelog 2018-07-12 12:18:46 -07:00
Jonathan Daugherty
6f4edc0228 Bump version, update changelog 2018-03-17 09:42:38 -07:00
Jonathan Daugherty
5d4498faa7 Bump version, update changelog 2018-02-04 15:23:57 -08:00
Ryan Scott
433b5b7f2d Add Semigroup instances 2018-02-04 16:30:29 -05:00
Jonathan Daugherty
9ae2df4d2b Bump version, update changelog 2018-01-05 08:40:00 -08:00
Jonathan Daugherty
86fd269e03 Bump version, update changelog 2017-12-02 22:36:14 -08:00
Jonathan Daugherty
4f5e7422df Bump version, update changelog 2017-10-06 14:15:34 -07:00
Jonathan Daugherty
17cf7a1de0 Bump version, update changelog 2017-10-06 13:07:26 -07:00
Jonathan Daugherty
452ed52069 Bump version, update changelog 2017-09-02 13:25:33 -07:00
Jonathan Daugherty
d14aae9ba5 Bump version, update changelog 2017-08-07 13:23:00 -07:00
Jonathan Daugherty
4bcebb1bfe Add support for terminal focus events 2017-08-07 13:17:28 -07:00
Jonathan Daugherty
c7d63260a7 Bump version, update changelog 2017-07-20 19:27:43 -07:00
Jonathan Daugherty
a551914519 package: raise base lower bound to be consistent with declared GHC support (fixes #126) 2017-05-21 10:02:00 -07:00
Jonathan Daugherty
a880f08933 Bump version 2017-05-20 08:41:25 -07:00
Michal Suchánek
2438c5417f Install docs as docs. 2017-03-01 00:24:15 +01:00
Jonathan Daugherty
564cd5cc00 Bump vty and vty-examples versions 2017-01-24 11:35:32 -08:00
Jonathan Daugherty
ba3ca5d219 Improve top-level package haddock 2017-01-22 12:17:38 -08:00
Jonathan Daugherty
9809a42189 API: remove dependency on data-default
This change removes Data.Default instances for Attr and Config. Use
'defAttr' and 'defaultConfig' (or 'mempty') instead of 'def'.
2017-01-22 12:00:55 -08:00
Jonathan Daugherty
629cb6e02a API: remove Graphics.Vty.Prelude, move DisplayRegion to Image module
This change removes the mostly-unused Graphics.Vty.Prelude module and
moves the DisplayRegion type and its accessors to Graphics.Vty.Image.
2017-01-22 09:42:18 -08:00
Jonathan Daugherty
77bcba3ad6 Rename CHANGELOG, improve formatting 2017-01-21 20:13:46 -08:00
Jonathan Daugherty
31eeb13e72 Remove TODO 2017-01-21 20:05:25 -08:00
Jonathan Daugherty
9e00564b5d vty.cabal: clean up description and update repository URLs 2017-01-21 19:37:03 -08:00
Jonathan Daugherty
4417241cff Move demo programs to demos/ 2017-01-21 19:36:37 -08:00
Jonathan Daugherty
0c96b212fc Raise base lower bound and disable GHC allowed-failing build as suggested in #117 2016-12-11 19:30:07 -08:00
Jonathan Daugherty
7d2807d940 Update changelog, bump version 2016-12-03 20:37:10 -08:00
Jonathan Daugherty
f2774c1047 Bump version, update CHANGELOG 2016-11-19 11:48:44 -08:00
Jonathan Daugherty
cd534c1028 Revert "Replace stale wcwidth implementation with utf8proc library call"
This reverts commit 437b27f052.
2016-11-19 11:46:35 -08:00